[LLVMbugs] [Bug 7182] New: Dangerous assertions in Parser::ParseLexedMethodDefs

bugzilla-daemon at llvm.org bugzilla-daemon at llvm.org
Thu May 20 16:19:36 PDT 2010


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

           Summary: Dangerous assertions in Parser::ParseLexedMethodDefs
           Product: clang
           Version: trunk
          Platform: PC
        OS/Version: All
            Status: NEW
          Keywords: crash-on-invalid
          Severity: normal
          Priority: P
         Component: C++
        AssignedTo: unassignedclangbugs at nondot.org
        ReportedBy: dgregor at apple.com
                CC: llvmbugs at cs.uiuc.edu, akyrtzi at gmail.com,
                    dgregor at apple.com


In two places, this method has the following assertions:

    assert(!PP.getSourceManager().isBeforeInTranslationUnit(origLoc,
                                                           Tok.getLocation())
&&
           "We consumed more than the cached tokens!");
    assert(Tok.getLocation() == origLoc &&
           "Tokens were left in the token stream!");


However, as part of error recovery, it's very possible that we'll end up
skipping beyond the end of the function or leaving tokens in the token stream,
so we shouldn't assert. Rather, we should gracefully drain the remaining tokens
(that were left over in the stream) and move on.

-- 
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