<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 --- - Assertion in getParamDecl on _setjmp(0)"
   href="https://llvm.org/bugs/show_bug.cgi?id=22961">22961</a>
          </td>
        </tr>

        <tr>
          <th>Summary</th>
          <td>Assertion in getParamDecl on _setjmp(0)
          </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>Frontend
          </td>
        </tr>

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

        <tr>
          <th>Reporter</th>
          <td>alexfrolov1878@yandex.ru
          </td>
        </tr>

        <tr>
          <th>CC</th>
          <td>llvmbugs@cs.uiuc.edu
          </td>
        </tr>

        <tr>
          <th>Classification</th>
          <td>Unclassified
          </td>
        </tr></table>
      <p>
        <div>
        <pre>$ cat test.c
void foo() {
  _setjmp(0);
}

$ clang --version
clang version 3.7.0 (trunk)
Target: x86_64-unknown-linux-gnu
Thread model: posix

$ clang -c test.c
clang: llvm/tools/clang/lib/CodeGen/../../include/clang/AST/Decl.h:1931: const
clang::ParmVarDecl* clang::FunctionDecl::getParamDecl(unsigned int) const:
Assertion `i < getNumParams() && "Illegal param #"' failed.
#0 0x43a0fce llvm::sys::PrintStackTrace(llvm::raw_ostream&)
llvm/lib/Support/Unix/Signals.inc:425:0
#1 0x43a134a PrintStackTraceSignalHandler(void*)
llvm/lib/Support/Unix/Signals.inc:483:0
#2 0x439fe70 SignalHandler(int) llvm/lib/Support/Unix/Signals.inc:199:0
#3 0x378300f500 __restore_rt (/lib64/libpthread.so.0+0x378300f500)
#4 0x3782c328a5 __GI_raise (/lib64/libc.so.6+0x3782c328a5)
#5 0x3782c34085 __GI_abort (/lib64/libc.so.6+0x3782c34085)
#6 0x3782c2ba1e __assert_fail_base (/lib64/libc.so.6+0x3782c2ba1e)
#7 0x3782c2bae0 __GI___assert_perror_fail (/lib64/libc.so.6+0x3782c2bae0)
#8 0x168386d clang::FunctionDecl::getParamDecl(unsigned int) const
llvm/tools/clang/lib/CodeGen/../../include/
clang/AST/Decl.h:1932:0
#9 0x189d11a
clang::CodeGen::CodeGenFunction::EmitBuiltinExpr(clang::FunctionDecl const*,
unsigned int, clang::CallExpr const*, clang::CodeGen::ReturnValueSlot) 
llvm/tools/clang/lib/CodeGen/CGBuiltin.cpp:1727:0 
<...>

This seems to stem from passing an i32 0 as the parameter to __setjmp, which is
recognized as a builtin, whose parameter 0 is not really of the proper type.
The issue is reproducible since r232188.</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>