mirror of
https://github.com/bitdefender/bddisasm.git
synced 2025-01-22 04:50:55 +00:00
#82: Handle 0 in OpSize::from_raw
This commit is contained in:
parent
935e2dfe5b
commit
fbb38f1518
@ -1,6 +1,6 @@
|
||||
[package]
|
||||
name = "bddisasm-sys"
|
||||
version = "0.2.1"
|
||||
version = "0.3.0"
|
||||
authors = ["Cristi Anichitei <ianichitei@bitdefender.com>"]
|
||||
edition = "2018"
|
||||
links = "bddisasm"
|
||||
|
@ -1,6 +1,6 @@
|
||||
[package]
|
||||
name = "bddisasm"
|
||||
version = "0.2.2"
|
||||
version = "0.3.0"
|
||||
authors = ["Cristi Anichitei <ianichitei@bitdefender.com>"]
|
||||
edition = "2018"
|
||||
license = "Apache-2.0"
|
||||
@ -14,7 +14,7 @@ categories = ["api-bindings", "hardware-support"]
|
||||
keywords = ["disassembler", "decoder", "x86", "amd64", "x86_64"]
|
||||
|
||||
[dependencies]
|
||||
bddisasm-sys = { version = "0.2.1", path = "../bddisasm-sys" }
|
||||
bddisasm-sys = { version = "0.3.0", path = "../bddisasm-sys" }
|
||||
|
||||
[features]
|
||||
std = []
|
||||
|
@ -1633,6 +1633,9 @@ mod tests {
|
||||
evex_rounding += 1;
|
||||
}
|
||||
}
|
||||
|
||||
// There is no `ND_SIZE_*` macro for 0, but the size 0 is valid, so test it here.
|
||||
assert_eq!(operand::OpSize::from_raw(0), Ok(operand::OpSize::Bytes(0)));
|
||||
}
|
||||
|
||||
#[test]
|
||||
|
@ -620,6 +620,7 @@ impl fmt::Display for OpSize {
|
||||
impl OpSize {
|
||||
pub(crate) fn from_raw(value: ffi::ND_OPERAND_SIZE) -> Result<Self, DecodeError> {
|
||||
match value {
|
||||
0 => Ok(OpSize::Bytes(0)),
|
||||
ffi::ND_SIZE_8BIT => Ok(OpSize::Bytes(1)),
|
||||
ffi::ND_SIZE_16BIT => Ok(OpSize::Bytes(2)),
|
||||
ffi::ND_SIZE_32BIT => Ok(OpSize::Bytes(4)),
|
||||
|
Loading…
Reference in New Issue
Block a user