diff --git a/Compiler/GC/types.py b/Compiler/GC/types.py index 0d82bbefa..3bf9a3115 100644 --- a/Compiler/GC/types.py +++ b/Compiler/GC/types.py @@ -789,7 +789,8 @@ def __init__(self, other=None, size=None): @classmethod def load_mem(cls, address, size=None): if isinstance(address, int) or len(address) == 1: - address = [address + i for i in range(size or 1)] + address = [address + i * cls.mem_size() + for i in range(size or 1)] else: assert size == None return cls( @@ -799,9 +800,7 @@ def store_in_mem(self, address): for x in self.v: if not util.is_constant(x): size = max(size, x.n) - if isinstance(address, int): - address = range(address, address + size) - elif len(address) == 1: + if isinstance(address, int) or len(address) == 1: address = [address + i * self.mem_size() for i in range(size)] else: