[clang static analyzer] core.NullDereference false negative with `*e = *c`
Opened this issue · 2 comments
Deleted user commented
date: 2023-03-14
commit: 0c0681b7414c385d0fd5fad302c0d48607262050
args: --analyze -Xclang -analyzer-stats -Xclang -analyzer-checker=core,debug.ExprInspection
test:
void clang_analyzer_eval();
int main()
{
int a = 0;
int d = 0;
int *c = (void *)0;
int *e = &d;
clang_analyzer_eval(c == 0);
for (; a < 4; a++)
{
;
}
clang_analyzer_eval(c == 0);
*e = *c;
}
report: llvm/llvm-project#61491
fix:
original:
Deleted user commented
See it live: https://godbolt.org/z/h3Mr5Mv3K
Deleted user commented
GSA not FN: https://godbolt.org/z/TnqnP6jed