Skip to content

Commit 54b305d

Browse files
gitolegivg
authored andcommitted
fixed minor bugs (#733)
* restored forgotten parentheses in x86 shift insns * updated testsuite
1 parent 8b04e0f commit 54b305d

File tree

2 files changed

+5
-5
lines changed

2 files changed

+5
-5
lines changed

plugins/x86/x86_lifter.ml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -886,9 +886,9 @@ module ToIR = struct
886886
(* undefined for SHL and SHR instructions where the count is greater than
887887
or equal to the size (in bits) of the destination operand *)
888888
match st with
889-
| LSHIFT -> Bil.(Cast (LOW, !!bool_t, var old lsr size - count))
889+
| LSHIFT -> Bil.(Cast (LOW, !!bool_t, var old lsr (size - count)))
890890
| RSHIFT | ARSHIFT ->
891-
Bil.(Cast (HIGH, !!bool_t, var old lsl size - count))
891+
Bil.(Cast (HIGH, !!bool_t, var old lsl (size - count)))
892892
| _ -> failwith "impossible"
893893
in
894894
Bil.[
@@ -917,8 +917,8 @@ module ToIR = struct
917917
let count_mask = Bil.(size - int_exp 1 s') in
918918
let e_count = Bil.(op2e s count land count_mask) in
919919
let new_cf = match st with
920-
| LSHIFT -> Bil.(Cast (LOW, !!bool_t, var was lsr size - e_count))
921-
| RSHIFT -> Bil.(Cast (HIGH, !!bool_t, var was lsl size - e_count))
920+
| LSHIFT -> Bil.(Cast (LOW, !!bool_t, var was lsr (size - e_count)))
921+
| RSHIFT -> Bil.(Cast (HIGH, !!bool_t, var was lsl (size - e_count)))
922922
| _ -> disfailwith "impossible" in
923923
let new_of = Bil.(Cast (HIGH, !!bool_t, (var was lxor e_dst))) in
924924
let unk_of =

testsuite

0 commit comments

Comments
 (0)