Skip to content

Windows X86 Debug build fails to error out "out-of-bounds memory access" #780

Open
@mgrang

Description

@mgrang
#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.

Metadata

Metadata

Assignees

Labels

bugThis labels issues that are bugs.priority:2This labels bugs that require immediate attention.

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions