[LLVMbugs] [Bug 6837] New: Null pointer reference

bugzilla-daemon at llvm.org bugzilla-daemon at llvm.org
Wed Apr 14 11:28:33 PDT 2010


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

           Summary: Null pointer reference
           Product: new-bugs
           Version: trunk
          Platform: PC
        OS/Version: Windows XP
            Status: NEW
          Severity: normal
          Priority: P
         Component: new bugs
        AssignedTo: unassignedbugs at nondot.org
        ReportedBy: John.Thompson.JTSoftware at gmail.com
                CC: llvmbugs at cs.uiuc.edu


In the InitListExpr::InitListExpr in Expr.cpp I'm seeing a call to this
function from InitListChecker::getStructuredSubobjectInit where the initExprs
parameter is 0, causing an assertion failure in the collections stuff starting
from this line (approx. Expr.cpp:741):

    InitExprs.insert(C, InitExprs.end(), initExprs, initExprs+numInits);

The caller is explicitly passing 0 in the third argument:

  InitListExpr *Result
    = new (SemaRef.Context) InitListExpr(SemaRef.Context,
                                         InitRange.getBegin(), 0, 0,
                                         InitRange.getEnd());

so it seems there is an arguments mismatch or logic error.  To work-around, I
just check for a null pointer and avoid the first call above, but because I'm
compiling a huge file with lots of errors, I don't know if it's related to
improper error recovery or not, though it seems this problem happens before the
first error is emitted.

If the above is not sufficient, I can take the time to try to narrow down a
test case.

-- 
Configure bugmail: http://llvm.org/bugs/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are on the CC list for the bug.



More information about the llvm-bugs mailing list