[clang] 3c8dfce - [clang][bytecode][NFC] Use RetPC in InterpFrame::getExpr() as well (#125200)

via cfe-commits cfe-commits at lists.llvm.org
Fri Jan 31 03:54:45 PST 2025


Author: Timm Baeder
Date: 2025-01-31T12:54:42+01:00
New Revision: 3c8dfce3def48982e47f2fbad5b78f409ef63467

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

LOG: [clang][bytecode][NFC] Use RetPC in InterpFrame::getExpr() as well (#125200)

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

Added: 
    

Modified: 
    clang/lib/AST/ByteCode/InterpFrame.cpp

Removed: 
    


################################################################################
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);
 }


        


More information about the cfe-commits mailing list