[clang] fd4c302 - [clang][Interp][NFC] Call discard() when discarding ExprWithCleanups

Timm Bäder via cfe-commits cfe-commits at lists.llvm.org
Wed May 3 23:47:03 PDT 2023


Author: Timm Bäder
Date: 2023-05-04T08:45:14+02:00
New Revision: fd4c302c4119ac946138c11494f15544bd4cc2de

URL: https://github.com/llvm/llvm-project/commit/fd4c302c4119ac946138c11494f15544bd4cc2de
DIFF: https://github.com/llvm/llvm-project/commit/fd4c302c4119ac946138c11494f15544bd4cc2de.diff

LOG: [clang][Interp][NFC] Call discard() when discarding ExprWithCleanups

Added: 
    

Modified: 
    clang/lib/AST/Interp/ByteCodeExprGen.cpp

Removed: 
    


################################################################################
diff  --git a/clang/lib/AST/Interp/ByteCodeExprGen.cpp b/clang/lib/AST/Interp/ByteCodeExprGen.cpp
index c3939996919e..ba6356136cab 100644
--- a/clang/lib/AST/Interp/ByteCodeExprGen.cpp
+++ b/clang/lib/AST/Interp/ByteCodeExprGen.cpp
@@ -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>


        


More information about the cfe-commits mailing list