Skip to content

[AddressSanitizer] Missed the out-of-bounds access to tentative array #156888

@XChy

Description

@XChy

Testcase:

int a[];
int b[7][10][3];
int main() {
  int *d = &a[8];
  *d = 0;
}

I met this case when I reduced the miscompilation cases with creduce and sanitizers. Both GCC and Clang treat a as a single-element array.
However, GCC sanitizer reports such a kind of out-of-bounds access, while Clang doesn't.

Godbolt link: https://godbolt.org/z/rhdnaaTf9

Metadata

Metadata

Assignees

No one assigned

    Labels

    compiler-rt:asanAddress sanitizerfalse-negativeWarning doesn't fire when it shouldquestionA question, not bug report. Check out https://llvm.org/docs/GettingInvolved.html instead!

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions