Skip to content

[clang][bytecode] Move CheckExtern call into isAccessible() block #152926

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

Merged
merged 1 commit into from
Aug 10, 2025

Conversation

tbaederr
Copy link
Contributor

This is where it belongs, but it was accidentally left where it was.

This is where it belongs, but it was accidentally left where it was.
@llvmbot llvmbot added clang Clang issues not falling into any other category clang:frontend Language frontend issues, e.g. anything involving "Sema" clang:bytecode Issues for the clang bytecode constexpr interpreter labels Aug 10, 2025
@llvmbot
Copy link
Member

llvmbot commented Aug 10, 2025

@llvm/pr-subscribers-clang

Author: Timm Baeder (tbaederr)

Changes

This is where it belongs, but it was accidentally left where it was.


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

1 Files Affected:

  • (modified) clang/lib/AST/ByteCode/Interp.cpp (+2-2)
diff --git a/clang/lib/AST/ByteCode/Interp.cpp b/clang/lib/AST/ByteCode/Interp.cpp
index 73507d2725a3f..931d3879f0ff8 100644
--- a/clang/lib/AST/ByteCode/Interp.cpp
+++ b/clang/lib/AST/ByteCode/Interp.cpp
@@ -885,12 +885,12 @@ bool CheckStore(InterpState &S, CodePtr OpPC, const Pointer &Ptr) {
   if (!Ptr.block()->isAccessible()) {
     if (!CheckLive(S, OpPC, Ptr, AK_Assign))
       return false;
+    if (!CheckExtern(S, OpPC, Ptr))
+      return false;
     return CheckDummy(S, OpPC, Ptr.block(), AK_Assign);
   }
   if (!CheckLifetime(S, OpPC, Ptr.getLifetime(), AK_Assign))
     return false;
-  if (!CheckExtern(S, OpPC, Ptr))
-    return false;
   if (!CheckRange(S, OpPC, Ptr, AK_Assign))
     return false;
   if (!CheckActive(S, OpPC, Ptr, AK_Assign))

@tbaederr tbaederr merged commit b08e86c into llvm:main Aug 10, 2025
13 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
clang:bytecode Issues for the clang bytecode constexpr interpreter 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