diff options
-rw-r--r-- | lib/AsmParser/llvmAsmParser.y | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/lib/AsmParser/llvmAsmParser.y b/lib/AsmParser/llvmAsmParser.y index 5544008542..263ef4c6ec 100644 --- a/lib/AsmParser/llvmAsmParser.y +++ b/lib/AsmParser/llvmAsmParser.y @@ -2823,9 +2823,9 @@ InstVal : ArithmeticOps Types ValueRef ',' ValueRef { // Check for call to invalid intrinsic to avoid crashing later. if (Function *theF = dyn_cast<Function>(V)) { - if (theF->hasName() && - 0 == strncmp(theF->getValueName()->getKeyData(), "llvm.", 5) && - !theF->getIntrinsicID(true)) + if (theF->hasName() && (strlen(theF->getValueName()->getKeyData()) >= 5)&& + (0 == strncmp(theF->getValueName()->getKeyData(), "llvm.", 5)) && + !theF->getIntrinsicID(true)) GEN_ERROR("Call to invalid LLVM intrinsic function '" + theF->getName() + "'"); } |