[LLVMbugs] [Bug 16079] New: False positive: Dereference of null pointer (confused by conditional operator?)

bugzilla-daemon at llvm.org bugzilla-daemon at llvm.org
Mon May 20 17:04:27 PDT 2013


http://llvm.org/bugs/show_bug.cgi?id=16079

            Bug ID: 16079
           Summary: False positive: Dereference of null pointer (confused
                    by conditional operator?)
           Product: clang
           Version: trunk
          Hardware: PC
                OS: Linux
            Status: NEW
          Severity: normal
          Priority: P
         Component: Static Analyzer
          Assignee: kremenek at apple.com
          Reporter: ed0.88.prez at gmail.com
                CC: llvmbugs at cs.uiuc.edu
    Classification: Unclassified

Created attachment 10550
  --> http://llvm.org/bugs/attachment.cgi?id=10550&action=edit
Preprocessed source of the problematic file

Hi,
as I told to the IRC, here it is the preprocessed source with the problem. The
message is reported for this code:

[code]
void DBaseStatusBar::BlendView (float blend[4])
{
    V_AddBlend (BaseBlendR / 255.f, BaseBlendG / 255.f, BaseBlendB / 255.f,
BaseBlendA, blend);
    V_AddPlayerBlend(CPlayer, blend, 1.0f, 228);

    if (screen->Accel2D || (CPlayer->camera != NULL && menuactive == MENU_Off
&& ConsoleState == c_up))
    {
        player_t *player = (CPlayer->camera != NULL && CPlayer->camera->player
!= NULL) ? CPlayer->camera->player : CPlayer; // <- here
        V_AddBlend (player->BlendR, player->BlendG, player->BlendB,
player->BlendA, blend);
    }

    V_SetBlend ((int)(blend[0] * 255.0f), (int)(blend[1] * 255.0f),
                (int)(blend[2] * 255.0f), (int)(blend[3] * 256.0f));
}
[/code]

-- 
You are receiving this mail because:
You are on the CC list for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-bugs/attachments/20130521/6fc97af9/attachment.html>


More information about the llvm-bugs mailing list