aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authoriximeow <me@iximeow.net>2019-01-05 02:05:27 -0800
committeriximeow <me@iximeow.net>2020-01-12 16:10:13 -0800
commita2fdcc2106024e7e9b1b119c9de50242706c9424 (patch)
tree42c52312c3b3d0bce5532925a7838cb62f810f61
parentb14958d55dd098d43719ef0284fe3de2d8f7c020 (diff)
fix incorrect handling of scale in some sib instances
-rw-r--r--src/lib.rs4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/lib.rs b/src/lib.rs
index 5941ee8..1a8a5fc 100644
--- a/src/lib.rs
+++ b/src/lib.rs
@@ -1379,10 +1379,10 @@ fn read_E(bytes_iter: &mut Iterator<Item=&u8>, prefixes: &Prefixes, m: u8, modbi
bank: width_to_gp_reg_bank(width)
};
if disp == 0 {
- *result = Operand::RegIndexBaseScale(base_reg, index_reg, ss);
+ *result = Operand::RegIndexBaseScale(base_reg, index_reg, 1u8 << ss);
Ok(())
} else {
- *result = Operand::RegIndexBaseScaleDisp(base_reg, index_reg, ss, disp as i32);
+ *result = Operand::RegIndexBaseScaleDisp(base_reg, index_reg, 1u8 << ss, disp as i32);
Ok(())
}
}