Author: Timm Baeder
Date: 2024-08-24T09:23:25+02:00
New Revision: 99b85cae628c1cc5641944290712cd84ccf1f6c8

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

LOG: [clang][bytecode][NFC] Add an additional assertion (#105927)

Since this must be true, add an assertion instead of just documenting it
via the comment.

Added: 
    

Modified: 
    clang/lib/AST/ByteCode/Interp.h

Removed: 
    


################################################################################
diff  --git a/clang/lib/AST/ByteCode/Interp.h b/clang/lib/AST/ByteCode/Interp.h
index 7ba51f737db491..81c547991c3d7d 100644
--- a/clang/lib/AST/ByteCode/Interp.h
+++ b/clang/lib/AST/ByteCode/Interp.h
@@ -2608,9 +2608,11 @@ inline bool Call(InterpState &S, CodePtr OpPC, const 
Function *Func,
     // the function we're about to call is a lambda call operator,
     // skip the CheckInvoke, since the ThisPtr is a null pointer
     // anyway.
-    if (!(S.Current->getFunction() &&
-          S.Current->getFunction()->isLambdaStaticInvoker() &&
-          Func->isLambdaCallOperator())) {
+    if (S.Current->getFunction() &&
+        S.Current->getFunction()->isLambdaStaticInvoker() &&
+        Func->isLambdaCallOperator()) {
+      assert(ThisPtr.isZero());
+    } else {
       if (!CheckInvoke(S, OpPC, ThisPtr))
         return false;
     }


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

Reply via email to