Skip to content

Commit

Permalink
[clang][Interp][NFC] Call discard() when discarding ExprWithCleanups
Browse files Browse the repository at this point in the history
  • Loading branch information
tbaederr committed May 4, 2023
1 parent 92f67dc commit fd4c302
Showing 1 changed file with 3 additions and 5 deletions.
8 changes: 3 additions & 5 deletions clang/lib/AST/Interp/ByteCodeExprGen.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -798,12 +798,10 @@ bool ByteCodeExprGen<Emitter>::VisitExprWithCleanups(
const Expr *SubExpr = E->getSubExpr();

assert(E->getNumObjects() == 0 && "TODO: Implement cleanups");
if (!this->visit(SubExpr))
return false;

if (DiscardResult)
return this->emitPopPtr(E);
return true;
return this->discard(SubExpr);

return this->visit(SubExpr);
}

template <class Emitter>
Expand Down

0 comments on commit fd4c302

Please sign in to comment.