MichaReiser / llvm-node

LLVM 9.0+ Node Bindings
MIT License
183 stars 29 forks source link

createAlloca return Segmentation fault: 11 #91

Closed vivekg13186 closed 5 years ago

vivekg13186 commented 5 years ago

let bb1 = llvm.BasicBlock.create(context,"start"); let irb1 = new llvm.IRBuilder(bb1); let d = irb1.createAlloca(llvm.Type.getDoubleTy(context),undefined,"d");

third line throws Segmentation fault: 11 error

vivekg13186 commented 5 years ago

sorry figure it out need to add basic block to function first let bb1 = llvm.BasicBlock.create(context,"start"); fun_g.addBasicBlock(bb1); let irb1 = new llvm.IRBuilder(bb1); let d = irb1.createAlloca(llvm.Type.getDoubleTy(context),undefined,"d");