mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2024-09-11 14:57:05 +00:00
Check for null MDNode element while printing comment.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@83172 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
bc9506f5ee
commit
4d7a2061f1
@ -874,7 +874,7 @@ static void WriteMDNodeComment(const MDNode *Node,
|
|||||||
formatted_raw_ostream &Out) {
|
formatted_raw_ostream &Out) {
|
||||||
if (Node->getNumElements() < 1)
|
if (Node->getNumElements() < 1)
|
||||||
return;
|
return;
|
||||||
ConstantInt *CI = dyn_cast<ConstantInt>(Node->getElement(0));
|
ConstantInt *CI = dyn_cast_or_null<ConstantInt>(Node->getElement(0));
|
||||||
if (!CI) return;
|
if (!CI) return;
|
||||||
unsigned Val = CI->getZExtValue();
|
unsigned Val = CI->getZExtValue();
|
||||||
unsigned Tag = Val & ~LLVMDebugVersionMask;
|
unsigned Tag = Val & ~LLVMDebugVersionMask;
|
||||||
|
Loading…
Reference in New Issue
Block a user