diff --git a/src/cdomains/intDomain.ml b/src/cdomains/intDomain.ml index 49065b9cc5..5a80d67bfe 100644 --- a/src/cdomains/intDomain.ml +++ b/src/cdomains/intDomain.ml @@ -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 diff --git a/tests/regression/39-signed-overflows/06-shiftleft.c b/tests/regression/39-signed-overflows/06-shiftleft.c index 987775c6f7..aff853ee36 100644 --- a/tests/regression/39-signed-overflows/06-shiftleft.c +++ b/tests/regression/39-signed-overflows/06-shiftleft.c @@ -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; }