File tree Expand file tree Collapse file tree 1 file changed +5
-1
lines changed Expand file tree Collapse file tree 1 file changed +5
-1
lines changed Original file line number Diff line number Diff line change @@ -194,7 +194,10 @@ function resolve_allocations(call::LLVM.Value)
194194 # Check that this points into the type tag (at a -1 offset)
195195 offset = operands (gep)[2 ]
196196 ! isa (offset, LLVM. ConstantInt) && continue
197- (convert (Int, offset) != - 1 ) && continue
197+ offset = convert (Int, offset)
198+
199+ # TODO : this should check gep->getSourceElementType() when that is available in LLVM C API
200+ (offset != - 1 && offset != - 8 ) && continue
198201
199202 # Now, look for the store into the type tag and count that as our allocation(s)
200203 for gepuse in uses (gep)
@@ -215,6 +218,7 @@ function resolve_allocations(call::LLVM.Value)
215218 push! (allocs, (store, type))
216219 end
217220 end
221+ isempty (allocs) && return [(call, Any)] # could not identify any type-tag (probably a bug!)
218222 return allocs
219223 end
220224 return nothing
You can’t perform that action at this time.
0 commit comments