diff --git a/lib/AsmParser/llvmAsmParser.y b/lib/AsmParser/llvmAsmParser.y index 88cc7d30dde..55440085426 100644 --- a/lib/AsmParser/llvmAsmParser.y +++ b/lib/AsmParser/llvmAsmParser.y @@ -2823,7 +2823,8 @@ InstVal : ArithmeticOps Types ValueRef ',' ValueRef { // Check for call to invalid intrinsic to avoid crashing later. if (Function *theF = dyn_cast(V)) { - if (theF->hasName() && 0 == strncmp(theF->getName().c_str(), "llvm.", 5)&& + if (theF->hasName() && + 0 == strncmp(theF->getValueName()->getKeyData(), "llvm.", 5) && !theF->getIntrinsicID(true)) GEN_ERROR("Call to invalid LLVM intrinsic function '" + theF->getName() + "'");