[LLVMdev] Patch to fix BrainF runtime assertion failure

Dan Hipschman dsh at linux.ucla.edu
Mon Aug 9 23:05:52 PDT 2010


Hi all,

I downloaded LLVM to play with today and found that the BrainF example
compiler fails with an assertion error like so:

examples$ ./BrainF -jit /tmp/test.bf
BrainF: Instructions.cpp:242: void llvm::CallInst::init(llvm::Value*, llvm::Value* const*, unsigned int): Assertion `(NumParams == FTy->getNumParams() || (FTy->isVarArg() && NumParams > FTy->getNumParams())) && "Calling a function with bad signature!"' failed.
Aborted

I tracked this down to bad arguments passed to the memset intrinsic.
>From the svn logs it looks like the memset intrinsic was given a new
prototype in April and the BrainF code hasn't been updated for this
yet.  This patch fixes the bug and the demo BF code I ran on it works
perfectly now.

Could someone apply this for me, please?

Dan Hipschman
-------------- next part --------------
A non-text attachment was scrubbed...
Name: BrainF.patch
Type: text/x-diff
Size: 1238 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20100809/99ec2c69/attachment.patch>


More information about the llvm-dev mailing list