[llvm-commits] [llvm] r110575 - /llvm/trunk/lib/MC/MachObjectWriter.cpp

Michael Spencer bigcheesegs at gmail.com
Tue Aug 10 09:03:37 PDT 2010


On Tue, Aug 10, 2010 at 11:19 AM, Daniel Dunbar <daniel at zuster.org> wrote:
> Hi Michael,
>
> On Mon, Aug 9, 2010 at 8:28 AM, Michael J. Spencer
> <bigcheesegs at gmail.com> wrote:
>> Author: mspencer
>> Date: Mon Aug  9 10:28:05 2010
>> New Revision: 110575
>>
>> URL: http://llvm.org/viewvc/llvm-project?rev=110575&view=rev
>> Log:
>> MC/MachO: Fix possible null pointer dereference.
>
> This isn't right, there is no possible null pointer dereference (it is
> implied by the absolute check). Please drop this condition, the code
> made more sense before.
>
>  - Daniel

Sorry about that. I should have checked isAbsolute(). Reverted in 110683.

>> Discovered by Microsoft Visual Studio 2010 Code Analysis.
>>
>> Modified:
>>    llvm/trunk/lib/MC/MachObjectWriter.cpp
>>
>> Modified: llvm/trunk/lib/MC/MachObjectWriter.cpp
>> URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/MC/MachObjectWriter.cpp?rev=110575&r1=110574&r2=110575&view=diff
>> ==============================================================================
>> --- llvm/trunk/lib/MC/MachObjectWriter.cpp (original)
>> +++ llvm/trunk/lib/MC/MachObjectWriter.cpp Mon Aug  9 10:28:05 2010
>> @@ -835,7 +835,7 @@
>>       // FIXME: Currently, these are never generated (see code below). I cannot
>>       // find a case where they are actually emitted.
>>       Type = RIT_Vanilla;
>> -    } else {
>> +    } else if (SD) {
>>       // Check whether we need an external or internal relocation.
>>       if (doesSymbolRequireExternRelocation(SD)) {
>>         IsExtern = 1;
>>
>>
>> _______________________________________________
>> 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