Skip to content

Commit cd768b1

Browse files
committed
trivial
1 parent a7758a8 commit cd768b1

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

backend/cmm_helpers.ml

+4-4
Original file line numberDiff line numberDiff line change
@@ -375,18 +375,18 @@ let guaranteed_to_be_small_int = function
375375
true
376376
| _ -> false
377377

378+
let is_defined_shift n = 0 <= n && n < arch_bits
379+
378380
let ignore_low_bit_int = function
379381
| Cop
380382
( Caddi,
381-
[(Cop (Clsl, [_; Cconst_int (n, _)], _) as c); Cconst_int (1, _)],
383+
[(Cop (Clsl, [_; Cconst_int (n, _)], _) as c); Cconst_int ((1 | -1), _)],
382384
_ )
383-
when n > 0 ->
385+
when n > 0 && is_defined_shift n ->
384386
c
385387
| Cop (Cor, [c; Cconst_int (1, _)], _) -> c
386388
| c -> c
387389

388-
let is_defined_shift n = 0 <= n && n < arch_bits
389-
390390
let[@inline] get_const = function
391391
| Cconst_int (i, _) -> Some (Nativeint.of_int i)
392392
| Cconst_natint (i, _) -> Some i

0 commit comments

Comments
 (0)