Skip to content

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

Closed
@0x21af

Description

@0x21af

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

Could you take a look when you have time? Many thanks!

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions