File tree Expand file tree Collapse file tree 1 file changed +12
-0
lines changed
clang/lib/Analysis/FlowSensitive Expand file tree Collapse file tree 1 file changed +12
-0
lines changed Original file line number Diff line number Diff line change @@ -662,6 +662,18 @@ class TransferVisitor : public ConstStmtVisitor<TransferVisitor> {
662
662
// The conditional operator can evaluate to either of the values of the
663
663
// two branches. To model this, join these two values together to yield
664
664
// the result of the conditional operator.
665
+ // Note: Most joins happen in `computeBlockInputState()`, but this case is
666
+ // different:
667
+ // - `computeBlockInputState()` (which in turn calls `Environment::join()`
668
+ // joins values associated with the _same_ expression or storage
669
+ // location, then associates the joined value with that expression or
670
+ // storage location. This join has nothing to do with transfer --
671
+ // instead, it joins together the results of performing transfer on two
672
+ // different blocks.
673
+ // - Here, we join values associated with _different_ expressions (the
674
+ // true and false branch), then associate the joined value with a third
675
+ // expression (the conditional operator itself). This join is what it
676
+ // means to perform transfer on the conditional operator.
665
677
if (Value *Val = Environment::joinValues (
666
678
S->getType (), TrueEnv->getValue (*S->getTrueExpr ()), *TrueEnv,
667
679
FalseEnv->getValue (*S->getFalseExpr ()), *FalseEnv, Env, Model))
You can’t perform that action at this time.
0 commit comments