[LLVMbugs] [Bug 1492] NEW: Wrong arguments for main() trigger assert in lli

bugzilla-daemon at cs.uiuc.edu bugzilla-daemon at cs.uiuc.edu
Sun Jun 3 09:38:00 PDT 2007


           Summary: Wrong arguments for main() trigger assert in lli
           Product: new-bugs
           Version: unspecified
          Platform: PC
        OS/Version: Linux
            Status: NEW
          Severity: normal
          Priority: P2
         Component: new bugs
        AssignedTo: unassignedbugs at nondot.org
        ReportedBy: maarten at treewalker.org

This program contains a bug: (argv and argc are swapped)

int main(char** argv, int argc) {
	return 0;

I compile it to bytecode like this:

$ llvm-g++ --emit-llvm -o wrongmain.bc -c wrongmain.cc

And then run it in the LLVM interpreter like this:

$ lli wrongmain.bc

Which triggers the following assertion:

lli: Instructions.cpp:210: void llvm::CallInst::init(llvm::Value*, 
llvm::Value* const*, unsigned int): Assertion `(i >= FTy->getNumParams() || 
FTy->getParamType(i) == Params[i]->getType()) && "Calling a function with a 
bad signature!"' failed.
lli((anonymous namespace)::PrintStackTrace()+0x19)[0x847fcb9]
lli(llvm::CallInst::init(llvm::Value*, llvm::Value* const*, unsigned 

I'm using LLVM 2.0 and its g++ front-end, compiled from source with GCC 4.1.3.

------- You are receiving this mail because: -------
You are on the CC list for the bug, or are watching someone who is.

More information about the llvm-bugs mailing list