Skip to content

Commit b94f34f

Browse files
author
Tony Tao
committed
add check for tab character
1 parent a44bf3d commit b94f34f

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

llvm/lib/Target/SystemZ/MCTargetDesc/SystemZHLASMInstPrinter.cpp

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,10 @@ void SystemZHLASMInstPrinter::printInst(const MCInst *MI, uint64_t Address,
3636
// Eat the first tab character and replace it with a space since it is
3737
// hardcoded in AsmWriterEmitter::EmitPrintInstruction
3838
// TODO: introduce a line prefix member to AsmWriter to avoid this problem
39-
O << " " << Str.substr(1, Str.length());
39+
if (!Str.empty() && Str.front() == '\t')
40+
O << " " << Str.substr(1, Str.length());
41+
else
42+
O << Str;
43+
4044
printAnnotation(O, Annot);
4145
}

0 commit comments

Comments
 (0)