Geoffrey1014 / SA_Bugs

record bugs of static analyzers
1 stars 1 forks source link

[clang static analyzer] `clang_analyzer_eval` result error for `((c ^= b || b) == b)` #49

Closed 0-0x41 closed 1 year ago

0-0x41 commented 1 year ago

date: 2023-1-16 commit: 0c0681b7414c385d0fd5fad302c0d48607262050 args: --analyze -Xclang -analyzer-stats -Xclang -analyzer-checker=core,debug.ExprInspection test:

void clang_analyzer_eval();

void a(int b)
{
    int c = 2;
    clang_analyzer_eval((c ^= b || b) == b);
    if ((c ^= b || b) == b)
    {
        clang_analyzer_eval((c ^= b || b) == b);
    }
}

report: https://github.com/llvm/llvm-project/issues/60122 fix: original:

0-0x41 commented 1 year ago

https://godbolt.org/z/rza1dfY7W