[llvm] r203745 - MC: fix possible NULL pointer dereference

Saleem Abdulrasool compnerd at compnerd.org
Sun Mar 16 17:37:02 PDT 2014


On Thu, Mar 13, 2014 at 8:38 AM, David Blaikie <dblaikie at gmail.com> wrote:

> On Wed, Mar 12, 2014 at 7:09 PM, Saleem Abdulrasool
> <compnerd at compnerd.org> wrote:
> > Author: compnerd
> > Date: Wed Mar 12 21:09:51 2014
> > New Revision: 203745
> >
> > URL: http://llvm.org/viewvc/llvm-project?rev=203745&view=rev
> > Log:
> > MC: fix possible NULL pointer dereference
> >
> > Avoid NULL pointer scenario found via clang's static analyzer.
>
> Any chance of a test case? If you replace the check with an assert
> does any easily accessible code (such as a Clang/LLVM bootstrap) fail?
> & a test case could be reduced from there.


Unfortunately, I couldnt find any easily accessible code failure for this
scenario.


> >
> > Modified:
> >     llvm/trunk/lib/MC/MCParser/AsmParser.cpp
> >
> > Modified: llvm/trunk/lib/MC/MCParser/AsmParser.cpp
> > URL:
> http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/MC/MCParser/AsmParser.cpp?rev=203745&r1=203744&r2=203745&view=diff
> >
> ==============================================================================
> > --- llvm/trunk/lib/MC/MCParser/AsmParser.cpp (original)
> > +++ llvm/trunk/lib/MC/MCParser/AsmParser.cpp Wed Mar 12 21:09:51 2014
> > @@ -2005,7 +2005,7 @@ bool AsmParser::parseMacroArguments(cons
> >        if (FAI >= NParameters) {
> >          Error(IDLoc,
> >                "parameter named '" + FA.Name + "' does not exist for
> macro '" +
> > -              M->Name + "'");
> > +              (M ? M->Name : "<unamed>") + "'");
> >          return true;
> >        }
> >        PI = FAI;
> >
> >
> > _______________________________________________
> > llvm-commits mailing list
> > llvm-commits at cs.uiuc.edu
> > http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits
>



-- 
Saleem Abdulrasool
compnerd (at) compnerd (dot) org
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20140316/0c0f6558/attachment.html>


More information about the llvm-commits mailing list