diff --git a/CHANGELOG.org b/CHANGELOG.org index 41b8eea..faeae79 100644 --- a/CHANGELOG.org +++ b/CHANGELOG.org @@ -5,6 +5,7 @@ + Documented build steps in notes.org + Imported CMPSKIP instructions that operate on 2 registers + Imported CMPJUMP instructions that operate on 3 registers ++ Incorporated bounds checking on all vm->Memory accesses ** Changed + Renamed xeh1 files to match current naming standard diff --git a/wrapper.c b/wrapper.c index 810bc80..6513ff3 100644 --- a/wrapper.c +++ b/wrapper.c @@ -37,7 +37,7 @@ void execute_vm(struct lilith* vm) void initialize_lilith() { struct lilith* vm; - vm = create_vm(1 << 22); + vm = create_vm(1 << 20); Globalvm = vm; } @@ -67,11 +67,13 @@ void set_register(unsigned int reg, unsigned int value) void set_memory(unsigned int address, unsigned char value) { + outside_of_world(Globalvm, address, "Address outside of World"); Globalvm->memory[address] = value; } unsigned char get_byte(unsigned int add) { + outside_of_world(Globalvm, add, "Address outside of World"); return Globalvm->memory[add]; }