diff options
author | Kartik Agaram <vc@akkartik.com> | 2018-07-08 22:40:07 -0700 |
---|---|---|
committer | Kartik Agaram <vc@akkartik.com> | 2018-07-08 22:40:07 -0700 |
commit | 1e1eca1742ec396e5daa686e6b425dbd11f25baf (patch) | |
tree | 516b1f6ddc938ae3c788f6b617d8536971864176 | |
parent | b0832f6676c945c9b1262f97a34765b859299988 (diff) | |
download | mu-1e1eca1742ec396e5daa686e6b425dbd11f25baf.tar.gz |
4329
Drop a safety net; we now assume that Memory is large enough for any addresses we may encounter. Dropping all comparisons with Mem.size() now makes our Memory_offset indirection airtight.
-rw-r--r-- | subx/010core.cc | 1 | ||||
-rw-r--r-- | subx/011direct_addressing.cc | 2 |
2 files changed, 0 insertions, 3 deletions
diff --git a/subx/010core.cc b/subx/010core.cc index dbab5fc5..d35472da 100644 --- a/subx/010core.cc +++ b/subx/010core.cc @@ -214,7 +214,6 @@ void load_program(istream& in, uint32_t addr) { write_mem_u8(addr, to_byte(c1, c2)); trace(99, "load") << addr << " -> " << HEXBYTE << NUM(read_mem_u8(addr)) << end(); addr++; - if (addr >= Mem.size()) Mem.resize(Mem.size()*2); } End_of_program = addr; } diff --git a/subx/011direct_addressing.cc b/subx/011direct_addressing.cc index 1e0375f6..cf61fb82 100644 --- a/subx/011direct_addressing.cc +++ b/subx/011direct_addressing.cc @@ -40,8 +40,6 @@ int32_t* effective_address(uint8_t modrm) { exit(1); } //: other mods are indirect, and they'll set addr appropriately - assert(addr > 0); - assert(addr + sizeof(int32_t) <= Mem.size()); return mem_addr_i32(addr); } |