Okay, yes there *is* a getKeyLength method on ValueName. And, it should be
authorReid Spencer <rspencer@reidspencer.com>
Mon, 16 Apr 2007 22:01:57 +0000 (22:01 +0000)
committerReid Spencer <rspencer@reidspencer.com>
Mon, 16 Apr 2007 22:01:57 +0000 (22:01 +0000)
used because we *do* want to allow nulls in names.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@36178 91177308-0d34-0410-b5e6-96231b3b80d8

lib/AsmParser/llvmAsmParser.y

index 263ef4c6eccb208764effac73023cd1eb9a2031f..a0c2e25bc5bce31ded406ba3ddde9f1c0024ed0d 100644 (file)
@@ -2823,7 +2823,7 @@ 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() && (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 '" +