Skip to content

Commit 785cadd

Browse files
authored
[clang][bytecode] Fix InterpFrame::dump() (#170682)
We should only call getThis() and getRVOPtr() if the frame has them.
1 parent 14bf95b commit 785cadd

File tree

1 file changed

+8
-2
lines changed

1 file changed

+8
-2
lines changed

clang/lib/AST/ByteCode/Disasm.cpp

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -519,8 +519,14 @@ LLVM_DUMP_METHOD void InterpFrame::dump(llvm::raw_ostream &OS,
519519
OS << " (" << F->getName() << ")";
520520
}
521521
OS << "\n";
522-
OS.indent(Spaces) << "This: " << getThis() << "\n";
523-
OS.indent(Spaces) << "RVO: " << getRVOPtr() << "\n";
522+
if (hasThisPointer())
523+
OS.indent(Spaces) << "This: " << getThis() << "\n";
524+
else
525+
OS.indent(Spaces) << "This: -\n";
526+
if (Func && Func->hasRVO())
527+
OS.indent(Spaces) << "RVO: " << getRVOPtr() << "\n";
528+
else
529+
OS.indent(Spaces) << "RVO: -\n";
524530
OS.indent(Spaces) << "Depth: " << Depth << "\n";
525531
OS.indent(Spaces) << "ArgSize: " << ArgSize << "\n";
526532
OS.indent(Spaces) << "Args: " << (void *)Args << "\n";

0 commit comments

Comments
 (0)