Geoffrey1014/SA_Bugs

[clang static analyzer] core.NullDereference false negative with `*e = *c`

Opened this issue · 2 comments

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: