[LLVMdev] Assertion `castIsValid(getOpcode(), S, Ty) && "Illegal BitCast"' failed

Eli Friedman eli.friedman at gmail.com
Sun Nov 16 21:46:34 PST 2008


On Sun, Nov 16, 2008 at 9:34 PM, bhavani krishnan <bhavi63 at yahoo.com> wrote:
> Value *Ten = ConstantInt::get(Type::Int32Ty, 10);
> const Type *VoidPtrTy = PointerType::getUnqual(Type::Int8Ty);
> AllocaInst *AI = new AllocaInst(Type::Int32Ty);
> Value *ST = new StoreInst(Ten,AI,false,4,j);
> Value *BT = new BitCastInst(ST,VoidPtrTy,"",j);

Should be "new BitCastInst(AI,VoidPtrTy,"",j);"

> CallInst *CallPrint = CallInst::Create(myprint, BT, "", j);
> CallPrint->setTailCall(true);

-Eli



More information about the llvm-dev mailing list