Skip to content

Conversation

@tbaederr
Copy link
Contributor

Both getLocation() and getRange() use the RetPC if the current function doesn't have a usable body. Using PC here was just a typo.

Both getLocation() and getRange() use the RetPC if the current
function doesn't have a usable body. Using PC here was just a typo.
@llvmbot llvmbot added clang Clang issues not falling into any other category clang:frontend Language frontend issues, e.g. anything involving "Sema" labels Jan 31, 2025
@llvmbot
Copy link
Member

llvmbot commented Jan 31, 2025

@llvm/pr-subscribers-clang

Author: Timm Baeder (tbaederr)

Changes

Both getLocation() and getRange() use the RetPC if the current function doesn't have a usable body. Using PC here was just a typo.


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

1 Files Affected:

  • (modified) clang/lib/AST/ByteCode/InterpFrame.cpp (+1-1)
diff --git a/clang/lib/AST/ByteCode/InterpFrame.cpp b/clang/lib/AST/ByteCode/InterpFrame.cpp
index 20f67d9b1fd425..48a3db055c6c9b 100644
--- a/clang/lib/AST/ByteCode/InterpFrame.cpp
+++ b/clang/lib/AST/ByteCode/InterpFrame.cpp
@@ -244,7 +244,7 @@ SourceInfo InterpFrame::getSource(CodePtr PC) const {
 
 const Expr *InterpFrame::getExpr(CodePtr PC) const {
   if (Func && !funcHasUsableBody(Func) && Caller)
-    return Caller->getExpr(PC);
+    return Caller->getExpr(RetPC);
 
   return S.getExpr(Func, PC);
 }

@tbaederr tbaederr merged commit 3c8dfce into llvm:main Jan 31, 2025
11 checks passed
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