mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2024-12-13 04:30:23 +00:00
Minimally fix this code to not abort on mdnodes with integer data
wider than 64 bits. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@103309 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
02f0dbd97a
commit
66797ff2e1
@ -2024,9 +2024,9 @@ static void WriteMDNodeComment(const MDNode *Node,
|
|||||||
return;
|
return;
|
||||||
ConstantInt *CI = dyn_cast_or_null<ConstantInt>(Node->getOperand(0));
|
ConstantInt *CI = dyn_cast_or_null<ConstantInt>(Node->getOperand(0));
|
||||||
if (!CI) return;
|
if (!CI) return;
|
||||||
unsigned Val = CI->getZExtValue();
|
APInt Val = CI->getValue();
|
||||||
unsigned Tag = Val & ~LLVMDebugVersionMask;
|
APInt Tag = Val & ~APInt(Val.getBitWidth(), LLVMDebugVersionMask);
|
||||||
if (Val < LLVMDebugVersion)
|
if (Val.ult(LLVMDebugVersion))
|
||||||
return;
|
return;
|
||||||
|
|
||||||
Out.PadToColumn(50);
|
Out.PadToColumn(50);
|
||||||
@ -2040,8 +2040,10 @@ static void WriteMDNodeComment(const MDNode *Node,
|
|||||||
Out << "; [ DW_TAG_vector_type ]";
|
Out << "; [ DW_TAG_vector_type ]";
|
||||||
else if (Tag == dwarf::DW_TAG_user_base)
|
else if (Tag == dwarf::DW_TAG_user_base)
|
||||||
Out << "; [ DW_TAG_user_base ]";
|
Out << "; [ DW_TAG_user_base ]";
|
||||||
else if (const char *TagName = dwarf::TagString(Tag))
|
else if (Tag.isIntN(32)) {
|
||||||
Out << "; [ " << TagName << " ]";
|
if (const char *TagName = dwarf::TagString(Tag.getZExtValue()))
|
||||||
|
Out << "; [ " << TagName << " ]";
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void AssemblyWriter::writeAllMDNodes() {
|
void AssemblyWriter::writeAllMDNodes() {
|
||||||
|
Loading…
Reference in New Issue
Block a user