Skip to content

Commit bde3b51

Browse files
authored
[DebugInfo] Fix translation of DebugSource Text argument (#2003)
Handle the case when we have `DebugInfoNone` for the Text argument which is usually expected to be `OpString`.
1 parent aabcaf8 commit bde3b51

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

lib/SPIRV/SPIRVToLLVMDbgTran.cpp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -138,6 +138,8 @@ const std::string &SPIRVToLLVMDbgTran::getString(const SPIRVId Id) {
138138
const std::string
139139
SPIRVToLLVMDbgTran::getStringContinued(const SPIRVId Id,
140140
SPIRVExtInst *DebugInst) {
141+
if (getDbgInst<SPIRVDebug::DebugInfoNone>(Id))
142+
return "";
141143
std::string Str = BM->get<SPIRVString>(Id)->getStr();
142144
using namespace SPIRVDebug::Operand::SourceContinued;
143145
for (auto *I : DebugInst->getContinuedInstructions()) {

0 commit comments

Comments
 (0)