[Bug sanitizer/95279] UBSan doesn't seem to detect pointer overflow in certain cases

frantisek at sumsal dot cz gcc-bugzilla@gcc.gnu.org
Mon May 25 10:24:35 GMT 2020


--- Comment #7 from Frantisek Sumsal <frantisek at sumsal dot cz> ---
Maybe I'm missing something here, but isn't detecting pointer overflows (even
in cases where it's apparently not an undefined behavior) the sole purpose of
-fsanitize=pointer-overflow (which, to my knowledge, is enabled by default when
using -fsanitize=undefined)?

As described in [0]:

    This option enables instrumentation of pointer arithmetics. If the pointer
arithmetics overflows, a run-time error is issued.

[0] https://gcc.gnu.org/onlinedocs/gcc/Instrumentation-Options.html

More information about the Gcc-bugs mailing list