summaryrefslogtreecommitdiff
path: root/llvm/lib/CodeGen/MIRParser/MIParser.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'llvm/lib/CodeGen/MIRParser/MIParser.cpp')
-rw-r--r--llvm/lib/CodeGen/MIRParser/MIParser.cpp2
1 files changed, 2 insertions, 0 deletions
diff --git a/llvm/lib/CodeGen/MIRParser/MIParser.cpp b/llvm/lib/CodeGen/MIRParser/MIParser.cpp
index 5c6a41af97a..da758da873c 100644
--- a/llvm/lib/CodeGen/MIRParser/MIParser.cpp
+++ b/llvm/lib/CodeGen/MIRParser/MIParser.cpp
@@ -779,6 +779,8 @@ bool MIParser::parse(MachineInstr *&MI) {
MDNode *Node = nullptr;
if (parseMDNode(Node))
return true;
+ if (!isa<DILocation>(Node))
+ return error("referenced metadata is not a DILocation");
DebugLocation = DebugLoc(Node);
}