Skip to content

Boolean equality of two undefined bools incorrectly interpreted as "true" #82802

Open
@ymand

Description

@ymand

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);

if (LHSValue == RHSValue)
return Env.getBoolLiteralValue(true);

Therefore, when both are null, the equality will be interpreted as true.

Metadata

Metadata

Assignees

Labels

clang:dataflowClang Dataflow Analysis framework - https://clang.llvm.org/docs/DataFlowAnalysisIntro.html

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions