[LLVMdev] Constructing a varargs CallInst

Duncan Sands baldrick at free.fr
Wed Apr 28 04:57:14 PDT 2010

Hi Patrick,

> I'm trying to use CallInst::Create to construct a call to a variadic
> function, and I'm running into the following assertion failure:
> /localhome/simmon12/workspace/llvm-sources/lib/VMCore/Instructions.cpp:297:
> 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.

one of the parameters you are passing does not have the right type.
If you run in gdb, you can do:
   call FTy->getParamType(i)->dump()
   call Params[i]->getType()->dump()
to see what's going on.



More information about the llvm-dev mailing list