diff --git a/lib/AsmParser/llvmAsmParser.cpp.cvs b/lib/AsmParser/llvmAsmParser.cpp.cvs index c8f7599b80c..4108df2c143 100644 --- a/lib/AsmParser/llvmAsmParser.cpp.cvs +++ b/lib/AsmParser/llvmAsmParser.cpp.cvs @@ -5488,7 +5488,7 @@ yyreduce: // Check for call to invalid intrinsic to avoid crashing later. if (Function *theF = dyn_cast(V)) { - if (theF->hasName() && (strlen(theF->getValueName()->getKeyData()) >= 5)&& + if (theF->hasName() && (theF->getValueName()->getKeyLength() >= 5) && (0 == strncmp(theF->getValueName()->getKeyData(), "llvm.", 5)) && !theF->getIntrinsicID(true)) GEN_ERROR("Call to invalid LLVM intrinsic function '" + diff --git a/lib/AsmParser/llvmAsmParser.y.cvs b/lib/AsmParser/llvmAsmParser.y.cvs index 263ef4c6ecc..a0c2e25bc5b 100644 --- a/lib/AsmParser/llvmAsmParser.y.cvs +++ b/lib/AsmParser/llvmAsmParser.y.cvs @@ -2823,7 +2823,7 @@ InstVal : ArithmeticOps Types ValueRef ',' ValueRef { // Check for call to invalid intrinsic to avoid crashing later. if (Function *theF = dyn_cast(V)) { - if (theF->hasName() && (strlen(theF->getValueName()->getKeyData()) >= 5)&& + if (theF->hasName() && (theF->getValueName()->getKeyLength() >= 5) && (0 == strncmp(theF->getValueName()->getKeyData(), "llvm.", 5)) && !theF->getIntrinsicID(true)) GEN_ERROR("Call to invalid LLVM intrinsic function '" +