[LLVMbugs] [Bug 6720] New: invalid jump diagnostic refers to deleted Stmt

bugzilla-daemon at llvm.org bugzilla-daemon at llvm.org
Fri Mar 26 21:53:45 PDT 2010


           Summary: invalid jump diagnostic refers to deleted Stmt
           Product: clang
           Version: trunk
          Platform: PC
        OS/Version: Linux
            Status: NEW
          Severity: normal
          Priority: P
         Component: -New Bugs
        AssignedTo: unassignedclangbugs at nondot.org
        ReportedBy: nlewycky at google.com
                CC: llvmbugs at cs.uiuc.edu

This is a crash on invalid. Given the code:

  extern int f(char *);

  void test(const UnknownType &RHS) {
    if (int Res = f(RHS.Data))

clang will crash inside of Sema::DiagnoseInvalidJumps as it tries to access the
Stmt inside the if-statement.

clang::Stmt::StmtClass clang::Stmt::getStmtClass() const: Assertion `RefCount
>= 1 && "Referencing already-destroyed statement!"' failed.

Repro with "clang -fsyntax-only test.cc". The relevant part of the stack trace

#3  0x00000000004568e3 in clang::Stmt::getStmtClass (this=0x28e00f0)
#11 0x00000000007d98f5 in BuildScopeInformation (this=0x7fffffffb370, 
    S=0x28e0240, ParentScope=0) at JumpDiagnostics.cpp:128
#12 0x00000000007d9d9f in BuildScopeInformation (this=0x7fffffffb370, 
    S=0x28e0278, ParentScope=0) at JumpDiagnostics.cpp:215
#13 0x00000000007d9e63 in JumpScopeChecker (this=0x7fffffffb370, 
    Body=0x28e0278, s=...) at JumpDiagnostics.cpp:72
#14 0x00000000007d9ea1 in clang::Sema::DiagnoseInvalidJumps (
    this=0x7fffffffc810, Body=0x28e0278) at JumpDiagnostics.cpp:332

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