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

Daniel Dunbar daniel at zuster.org
Tue Aug 10 08:19:37 PDT 2010


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

> 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