[LLVMdev] Poolalloc asserts when passing in pool descriptors

Harmen van der Spek hvdspek at liacs.nl
Fri Nov 13 13:02:07 PST 2009


Hi,

The poolalloc library fails in TransformFunctionBody.cpp, line 746

---
Value *ArgVal = ConstantAggregateZero::get(PoolAllocate::PoolDescPtrTy);
---

opt -load /path_to_lib/libpoolalloc.dylib -poolalloc constaggr.bc -o 
opt.bc -f

triggers the problem (bc file attached).

Assertion failed: ((isa<StructType>(Ty) || isa<ArrayType>(Ty) || 
isa<VectorType>(Ty)) && "Cannot create an aggregate zero of 
non-aggregate type!"), function get, file lib/VMCore/Constants.cpp, line 
859.

Changing it to
Value *ArgVal = Constant::getNullValue(PoolAllocate::PoolDescPtrTy);

which was used in revision 72001, fixes the problem.


Harmen
-------------- next part --------------
A non-text attachment was scrubbed...
Name: constaggr.bc
Type: application/octet-stream
Size: 704 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20091113/65b3e730/attachment.obj>


More information about the llvm-dev mailing list