Skip to content

Commit 854c273

Browse files
committed
[clang][dataflow] Weaken guard to only check for storage location
Weaken the guard for whether a sub-expression has been evaluated to only check for the storage location, instead of checking for the value. It should be sufficient to check for the storage location, as we don't necessarily guarantee that a value will be set for the location (although this is currently true right now). Differential Revision: https://reviews.llvm.org/D125823
1 parent 11a7e77 commit 854c273

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

clang/lib/Analysis/FlowSensitive/TypeErasedDataflowAnalysis.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -104,7 +104,7 @@ class TerminatorVisitor : public ConstStmtVisitor<TerminatorVisitor> {
104104
private:
105105
void extendFlowCondition(const Expr &Cond) {
106106
// The terminator sub-expression might not be evaluated.
107-
if (Env.getValue(Cond, SkipPast::None) == nullptr)
107+
if (Env.getStorageLocation(Cond, SkipPast::None) == nullptr)
108108
transfer(StmtToEnv, Cond, Env);
109109

110110
// FIXME: The flow condition must be an r-value, so `SkipPast::None` should

0 commit comments

Comments
 (0)