[LLVMbugs] [Bug 22961] New: Assertion in getParamDecl on _setjmp(0)

bugzilla-daemon at llvm.org bugzilla-daemon at llvm.org
Fri Mar 20 01:43:47 PDT 2015


https://llvm.org/bugs/show_bug.cgi?id=22961

            Bug ID: 22961
           Summary: Assertion in getParamDecl on _setjmp(0)
           Product: clang
           Version: trunk
          Hardware: PC
                OS: Linux
            Status: NEW
          Severity: normal
          Priority: P
         Component: Frontend
          Assignee: unassignedclangbugs at nondot.org
          Reporter: alexfrolov1878 at yandex.ru
                CC: llvmbugs at cs.uiuc.edu
    Classification: Unclassified

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

-- 
You are receiving this mail because:
You are on the CC list for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-bugs/attachments/20150320/4be42de4/attachment.html>


More information about the llvm-bugs mailing list