diff --git a/llvm/lib/AsmParser/llvmAsmParser.y b/llvm/lib/AsmParser/llvmAsmParser.y index 263ef4c6eccb..a0c2e25bc5bc 100644 --- a/llvm/lib/AsmParser/llvmAsmParser.y +++ b/llvm/lib/AsmParser/llvmAsmParser.y @@ -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 '" +