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

David Blaikie dblaikie at gmail.com
Sun Mar 16 17:53:20 PDT 2014


On Sun, Mar 16, 2014 at 5:37 PM, Saleem Abdulrasool
<compnerd at compnerd.org> wrote:
> 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.

Could we just replace this with an assert, then? (& eventually if we
find a buildbot/user/etc that fails we'll be able to add the right
test case) Or is there good reason to believe this might be null in an
obscure case?

>
>>
>> >
>> > 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



More information about the llvm-commits mailing list