Skip to content

Commit

Permalink
<< Fix wrong order of minimal/maximal
Browse files Browse the repository at this point in the history
  • Loading branch information
michael-schwarz committed Nov 19, 2023
1 parent c8c49a5 commit f6cef72
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
2 changes: 1 addition & 1 deletion src/cdomains/intDomain.ml
Original file line number Diff line number Diff line change
Expand Up @@ -874,7 +874,7 @@ struct
| true, _
| _ , true -> raise (ArithmeticOnIntegerBot (Printf.sprintf "%s op %s" (show a) (show b)))
| _ ->
match a, maximal b, minimal b with
match a, minimal b, maximal b with
| Some a, Some bl, Some bu when (Ints_t.compare bl Ints_t.zero >= 0) ->
(try
let r = IArith.shiftleft a (Ints_t.to_int bl, Ints_t.to_int bu) in
Expand Down
3 changes: 3 additions & 0 deletions tests/regression/39-signed-overflows/06-shiftleft.c
Original file line number Diff line number Diff line change
Expand Up @@ -19,5 +19,8 @@ int main()
__goblint_check(r >= 8);
__goblint_check(r <= 16);

int regval;
unsigned long bla = (unsigned long )((1 << ((int )regval >> 6)) << 20); //WARN

return 0;
}

0 comments on commit f6cef72

Please sign in to comment.