Author: Timm Bäder
Date: 2023-02-03T16:07:14+01:00
New Revision: a7f3bcaa8409f67e604bcbe22a960f54ebc657ef

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

LOG: [clang][Interp][NFCI] Handle DiscardResult for ExprWithCleanups

Just pop the pointer.

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 b02e3ae02ae7..f8ee3a80326b 100644
--- a/clang/lib/AST/Interp/ByteCodeExprGen.cpp
+++ b/clang/lib/AST/Interp/ByteCodeExprGen.cpp
@@ -788,7 +788,12 @@ bool ByteCodeExprGen<Emitter>::VisitExprWithCleanups(
   const Expr *SubExpr = E->getSubExpr();
 
   assert(E->getNumObjects() == 0 && "TODO: Implement cleanups");
-  return this->visit(SubExpr);
+  if (!this->visit(SubExpr))
+    return false;
+
+  if (DiscardResult)
+    return this->emitPopPtr(E);
+  return true;
 }
 
 template <class Emitter>


        
_______________________________________________
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to