aboutsummaryrefslogtreecommitdiff
path: root/llvm/lib/CodeGen/MIRParser/MIParser.cpp
diff options
context:
space:
mode:
authorMatthias Braun <matze@braunis.de>2018-10-01 17:50:52 +0000
committerMatthias Braun <matze@braunis.de>2018-10-01 17:50:52 +0000
commit7159daa68ebc88abf88196ef960bcf42cdff30dd (patch)
tree97ec98fc177abc3308bdbbf2f6db32da3c2884da /llvm/lib/CodeGen/MIRParser/MIParser.cpp
parent7cd67904f77608a70fa87aacb254fff6bc94f6ba (diff)
downloadllvm-7159daa68ebc88abf88196ef960bcf42cdff30dd.zip
llvm-7159daa68ebc88abf88196ef960bcf42cdff30dd.tar.gz
llvm-7159daa68ebc88abf88196ef960bcf42cdff30dd.tar.bz2
MIRParser: Check that instructions only reference DILocation metadata
llvm-svn: 343505
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 5c6a41a..da758da 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);
}