Open ymand opened 7 months ago
The built-in interpretation of boolean equality forgets to check for nullness before checking for pointer equality:
Value *LHSValue = Env.getValue(LHS); Value *RHSValue = Env.getValue(RHS); if (LHSValue == RHSValue) return Env.getBoolLiteralValue(true);
https://github.com/llvm/llvm-project/blob/dfa1d9b027e677cf1379dffee0059261a34f3481/clang/lib/Analysis/FlowSensitive/Transfer.cpp#L58-L59
Therefore, when both are null, the equality will be interpreted as true.
Hello @ymand the fix seems pretty easy , If you are not currently working on this may I open a PR?
The built-in interpretation of boolean equality forgets to check for nullness before checking for pointer equality:
https://github.com/llvm/llvm-project/blob/dfa1d9b027e677cf1379dffee0059261a34f3481/clang/lib/Analysis/FlowSensitive/Transfer.cpp#L58-L59
Therefore, when both are null, the equality will be interpreted as true.