================
@@ -169,8 +169,16 @@ class TransferVisitor : public
ConstStmtVisitor<TransferVisitor> {
break;
auto *RHSVal = Env.getValue(*RHS);
- if (RHSVal == nullptr)
+ if (RHSVal == nullptr) {
RHSVal = Env.createValue(LHS->getType());
+ if (RHSVal == nullptr) {
+ // At least make sure the old value is gone. It's unlikely to be
there
+ // in the first place given that we don't even know how to create
+ // a basic unknown value of that type.
+ Env.clearValue(*LHSLoc);
----------------
haoNoQ wrote:
This is a purely imaginary situation. I have no reproducer for the situation
where the value was actually already there. I could, like,
`assert(!Env.getValue(*LHSLoc))` but that feels counterproductive. It's more
productive to encourage people make values even if they can't do that in every
case. (I'm also worried about future side effects in such an assertion.)
https://github.com/llvm/llvm-project/pull/179788
_______________________________________________
cfe-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits