<html>
    <head>
      <base href="https://llvm.org/bugs/" />
    </head>
    <body><table border="1" cellspacing="0" cellpadding="8">
        <tr>
          <th>Bug ID</th>
          <td><a class="bz_bug_link 
          bz_status_NEW "
   title="NEW --- - Crash in CodeGen when processing default switch statement"
   href="https://llvm.org/bugs/show_bug.cgi?id=28609">28609</a>
          </td>
        </tr>

        <tr>
          <th>Summary</th>
          <td>Crash in CodeGen when processing default switch statement
          </td>
        </tr>

        <tr>
          <th>Product</th>
          <td>clang
          </td>
        </tr>

        <tr>
          <th>Version</th>
          <td>trunk
          </td>
        </tr>

        <tr>
          <th>Hardware</th>
          <td>PC
          </td>
        </tr>

        <tr>
          <th>OS</th>
          <td>Linux
          </td>
        </tr>

        <tr>
          <th>Status</th>
          <td>NEW
          </td>
        </tr>

        <tr>
          <th>Severity</th>
          <td>normal
          </td>
        </tr>

        <tr>
          <th>Priority</th>
          <td>P
          </td>
        </tr>

        <tr>
          <th>Component</th>
          <td>LLVM Codegen
          </td>
        </tr>

        <tr>
          <th>Assignee</th>
          <td>unassignedclangbugs@nondot.org
          </td>
        </tr>

        <tr>
          <th>Reporter</th>
          <td>rtrieu@google.com
          </td>
        </tr>

        <tr>
          <th>CC</th>
          <td>llvm-bugs@lists.llvm.org
          </td>
        </tr>

        <tr>
          <th>Classification</th>
          <td>Unclassified
          </td>
        </tr></table>
      <p>
        <div>
        <pre>$ cat small.c
void fn1() {
  switch (0)
  case 0:
  do {
  default:
  ;
  } while (0)
    ;
}
$ clang small.c
1.    <eof> parser at end of file
2.    small.c:1:6: LLVM IR generation of declaration 'fn1'
3.    small.c:1:6: Generating code for declaration 'fn1'
4.    small.c:4:6: LLVM IR generation of compound statement ('{}')

Backtrace:
#3 clang::CodeGen::CodeGenFunction::EmitDefaultStmt(clang::DefaultStmt const&)
#4 clang::CodeGen::CodeGenFunction::EmitSimpleStmt(clang::Stmt const*)
#5 clang::CodeGen::CodeGenFunction::EmitStmt(clang::Stmt const*)
#6
clang::CodeGen::CodeGenFunction::EmitCompoundStmtWithoutScope(clang::CompoundStmt
const&, bool, clang::CodeGen::AggValueSlot)
#7 clang::CodeGen::CodeGenFunction::EmitCompoundStmt(clang::CompoundStmt
const&, bool, clang::CodeGen::AggValueSlot)
#8 clang::CodeGen::CodeGenFunction::EmitSimpleStmt(clang::Stmt const*)
#9 clang::CodeGen::CodeGenFunction::EmitStmt(clang::Stmt const*)

It looks like Clang was attempting to run CodeGen on a default statement.  But
when it attempted to find the related switch statement, it got a null pointer
instead and segfaulted.  Located at #3, CGStmt.cpp:1264, SwitchInsn is null.</pre>
        </div>
      </p>
      <hr>
      <span>You are receiving this mail because:</span>
      
      <ul>
          <li>You are on the CC list for the bug.</li>
      </ul>
    </body>
</html>