diff --git a/llvm_emulator/stepper.py b/llvm_emulator/stepper.py index aeb641d..8a89db1 100644 --- a/llvm_emulator/stepper.py +++ b/llvm_emulator/stepper.py @@ -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: {}'