Open
Description
#include <limits.h>
void f() {
_Nt_array_ptr<char> p : count(INT_MIN) = "";
if (*(p + INT_MAX))
{}
}
clang -c a.c
On Linux Debug build you would see:
error: out-of-bounds memory access if (*(p + INT_MAX))
The error is expected since the declared bounds are INT_MIN
and the inferred bounds are (p, p + INT_MIN)
. Here we are accessing *(p + INT_MAX)
. So this is an out-of-bounds access.
However, on Windows X86 Debug build we do not see this error message. This needs to be fixed.