[llvm-commits] CVS: llvm/lib/AsmParser/llvmAsmParser.y

Reid Spencer rspencer at reidspencer.com
Mon Apr 16 14:46:27 PDT 2007


On Mon, 2007-04-16 at 14:33 -0700, Chris Lattner wrote:
> > Check length of string before we walk off the end of it.
> > Thanks, Chris.
> 
> <quoting reid>but I want to support nul characters in my names!</>

Okay, so this whole "ValueName" and "StringMap" thing I don't
understand. How do you get the length of a name now?

Reid.

> 
> -Chris
> 
> >
> > ---
> > Diffs of the changes:  (+3 -3)
> >
> >  llvmAsmParser.y |    6 +++---
> >  1 files changed, 3 insertions(+), 3 deletions(-)
> >
> >
> > Index: llvm/lib/AsmParser/llvmAsmParser.y
> > diff -u llvm/lib/AsmParser/llvmAsmParser.y:1.341 llvm/lib/AsmParser/ 
> > llvmAsmParser.y:1.342
> > --- llvm/lib/AsmParser/llvmAsmParser.y:1.341	Mon Apr 16 12:45:50 2007
> > +++ llvm/lib/AsmParser/llvmAsmParser.y	Mon Apr 16 15:31:06 2007
> > @@ -2823,9 +2823,9 @@
> >
> >      // 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() + "'");
> >      }
> >
> >
> >
> > _______________________________________________
> > llvm-commits mailing list
> > llvm-commits at cs.uiuc.edu
> > http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits
> 
> _______________________________________________
> llvm-commits mailing list
> llvm-commits at cs.uiuc.edu
> http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits




More information about the llvm-commits mailing list