[clang] [clang][bytecode] Fix InterpFrame::dump() (PR #170682)

Timm Baeder via cfe-commits cfe-commits at lists.llvm.org
Thu Dec 4 08:10:16 PST 2025


https://github.com/tbaederr created https://github.com/llvm/llvm-project/pull/170682

We should only call getThis() and getRVOPtr() the frame has them.

>From 1ecd7588a977f08031fa9c961eebc66e9407cdcc Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Timm=20B=C3=A4der?= <tbaeder at redhat.com>
Date: Thu, 4 Dec 2025 17:07:26 +0100
Subject: [PATCH] [clang][bytecode] Fix InterpFrame::dump()

We should only call getThis() and getRVOPtr() the frame has them.
---
 clang/lib/AST/ByteCode/Disasm.cpp | 10 ++++++++--
 1 file changed, 8 insertions(+), 2 deletions(-)

diff --git a/clang/lib/AST/ByteCode/Disasm.cpp b/clang/lib/AST/ByteCode/Disasm.cpp
index 30ed41cd37ca3..35937e3483e38 100644
--- a/clang/lib/AST/ByteCode/Disasm.cpp
+++ b/clang/lib/AST/ByteCode/Disasm.cpp
@@ -519,8 +519,14 @@ LLVM_DUMP_METHOD void InterpFrame::dump(llvm::raw_ostream &OS,
     OS << " (" << F->getName() << ")";
   }
   OS << "\n";
-  OS.indent(Spaces) << "This: " << getThis() << "\n";
-  OS.indent(Spaces) << "RVO: " << getRVOPtr() << "\n";
+  if (hasThisPointer())
+    OS.indent(Spaces) << "This: " << getThis() << "\n";
+  else
+    OS.indent(Spaces) << "This: -\n";
+  if (Func && Func->hasRVO())
+    OS.indent(Spaces) << "RVO: " << getRVOPtr() << "\n";
+  else
+    OS.indent(Spaces) << "RVO: -\n";
   OS.indent(Spaces) << "Depth: " << Depth << "\n";
   OS.indent(Spaces) << "ArgSize: " << ArgSize << "\n";
   OS.indent(Spaces) << "Args: " << (void *)Args << "\n";



More information about the cfe-commits mailing list