Skip to content

Commit 6af0f59

Browse files
committed
[dataflow] fix assert in Environment::getResultObjectLocation
When calling `Environment::getResultObjectLocation` with a CXXOperatorCallExpr that is a prvalue, we just hit an assert because no record was ever created.
1 parent 8f98c2c commit 6af0f59

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

clang/lib/Analysis/FlowSensitive/Transfer.cpp

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -536,6 +536,11 @@ class TransferVisitor : public ConstStmtVisitor<TransferVisitor> {
536536

537537
copyRecord(*LocSrc, *LocDst, Env);
538538
Env.setStorageLocation(*S, *LocDst);
539+
} else {
540+
// CXXOperatorCallExpr can be prvalues, in which case we must create a
541+
// record for them in order for `Environment::getResultObjectLocation()`
542+
// to be able to return a value.
543+
VisitCallExpr(S);
539544
}
540545
}
541546

0 commit comments

Comments
 (0)