diff options
author | Aryadev Chavali <aryadev@aryadevchavali.com> | 2023-10-22 21:39:32 +0100 |
---|---|---|
committer | Aryadev Chavali <aryadev@aryadevchavali.com> | 2023-10-22 21:47:32 +0100 |
commit | 789016a3439781eca20f3fca47e62dd8f2d2ea7b (patch) | |
tree | 3f6fc2dbba24dc63db9f13d229f4e66f058fecdf | |
parent | cc847037257b61f06817abdf05ab6657f589ca22 (diff) | |
download | ovm-789016a3439781eca20f3fca47e62dd8f2d2ea7b.tar.gz ovm-789016a3439781eca20f3fca47e62dd8f2d2ea7b.tar.bz2 ovm-789016a3439781eca20f3fca47e62dd8f2d2ea7b.zip |
Fix bug where negative opcodes lead to invalid bytecode parsing
-rw-r--r-- | src/inst.c | 2 |
1 files changed, 1 insertions, 1 deletions
@@ -323,7 +323,7 @@ inst_t inst_read_bytecode(darr_t *darr) return (inst_t){0}; inst_t inst = {0}; opcode_t opcode = darr->data[darr->used++]; - if (opcode > OP_HALT || opcode == NUMBER_OF_OPCODES) + if (opcode > OP_HALT || opcode == NUMBER_OF_OPCODES || opcode < OP_NOOP) // Translate to NOOP return inst; // Read operands |