[Bug sanitizer/82072] sanitizer does not detect an overflow from LLONG_MIN
jakub at gcc dot gnu.org
gcc-bugzilla@gcc.gnu.org
Fri Sep 1 14:27:00 GMT 2017
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=82072
--- Comment #2 from Jakub Jelinek <jakub at gcc dot gnu.org> ---
Why do you use LLONG_MIN for long variable?
Better testcase:
int
main ()
{
long long l = -__LONG_LONG_MAX__ - 1;
int i = 0;
i -= l;
i = -l;
return 0;
}
This is the effect of premature optimization in convert.c, perhaps for
-fsanitize=signed-integer-overflow we should punt in do_narrow if the argument
type is signed.
More information about the Gcc-bugs
mailing list