Consider empty structs to be of size 1.
This commit is contained in:
parent
bef14dfa24
commit
8afdf563b3
|
@ -486,7 +486,7 @@ def base_ty2size(base_ty):
|
|||
elif isinstance(base_ty, ll.PointerType):
|
||||
return 1
|
||||
elif isinstance(base_ty, ll.StructType):
|
||||
return sum(map(base_ty2size, base_ty.fields))
|
||||
return max(1, sum(map(base_ty2size, base_ty.fields)))
|
||||
else:
|
||||
# TODO
|
||||
err('base_ty2size: Unknown type or illegal type: {}'
|
||||
|
|
Loading…
Reference in New Issue
Block a user