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: [email protected]
        ReportedBy: [email protected]
                CC: [email protected]


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.
_______________________________________________
LLVMbugs mailing list
[email protected]
http://lists.cs.uiuc.edu/mailman/listinfo/llvmbugs

Reply via email to