Geoffrey1014 / SA_Bugs

record bugs of static analyzers
1 stars 1 forks source link

[clang static analyzer] false negative related to alpha.security.ArrayBoundV2 #77

Open 0x21af opened 8 months ago

0x21af commented 8 months ago

For this case, If l_2003[9][0] is accessed, the analyzer would report "Out of bound memory access". However, when accessing l_2003[9][0].a, it doesn't.

struct S1 {
    unsigned a : 2
} b() {
    struct S1 l_2003[5][4] = {};
    l_2003[9][0].a;
}
int main() { b(); }

See it live: https://godbolt.org/z/cxYYv6vMv

report: https://github.com/llvm/llvm-project/issues/70187