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

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


llvmbot wrote:


<!--LLVM PR SUMMARY COMMENT-->

@llvm/pr-subscribers-clang

Author: Timm Baeder (tbaederr)

<details>
<summary>Changes</summary>

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

``````````

</details>


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


More information about the cfe-commits mailing list