Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[clang][bytecode][NFC] Add an additional assertion #105927

Merged
merged 1 commit into from
Aug 24, 2024
Merged

Conversation

tbaederr
Copy link
Contributor

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

Since this must be true, add an assertion instead of just documenting it
via the comment.
@llvmbot llvmbot added clang Clang issues not falling into any other category clang:frontend Language frontend issues, e.g. anything involving "Sema" labels Aug 24, 2024
@llvmbot
Copy link
Member

llvmbot commented Aug 24, 2024

@llvm/pr-subscribers-clang

Author: Timm Baeder (tbaederr)

Changes

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


Full diff: https://github.com/llvm/llvm-project/pull/105927.diff

1 Files Affected:

  • (modified) clang/lib/AST/ByteCode/Interp.h (+5-3)
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;
     }

@tbaederr tbaederr merged commit 99b85ca into llvm:main Aug 24, 2024
11 checks passed
5chmidti pushed a commit that referenced this pull request Aug 24, 2024
Since this must be true, add an assertion instead of just documenting it
via the comment.
dmpolukhin pushed a commit to dmpolukhin/llvm-project that referenced this pull request Sep 2, 2024
Since this must be true, add an assertion instead of just documenting it
via the comment.
qiaojbao pushed a commit to GPUOpen-Drivers/llvm-project that referenced this pull request Sep 30, 2024
…ee8740921

Local branch amd-gfx f09ee87 Merged main:c81d6665601d648c1a5349b665ee6019f3786352 into amd-gfx:80a4987ce388
Remote branch main 99b85ca [clang][bytecode][NFC] Add an additional assertion (llvm#105927)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
clang:frontend Language frontend issues, e.g. anything involving "Sema" clang Clang issues not falling into any other category
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants