diff options
Diffstat (limited to 'dis.c')
-rw-r--r-- | dis.c | 8 |
1 files changed, 4 insertions, 4 deletions
@@ -6,8 +6,8 @@ void disasm_chunk(Chunk *ch) { - for (size_t ip = 0; ip < ch->blen; ) { - uint8_t instr = ch->b[ip]; + for (size_t ip = 0; ip < ch->bc.len; ) { + uint8_t instr = ch->bc.d[ip]; printf("%04zd\t",ip); ip ++; #define SIMPLE_INSTR(opcode, str) \ @@ -15,9 +15,9 @@ void disasm_chunk(Chunk *ch) { switch (instr) { SIMPLE_INSTR(OP_RET, "ret") case OP_LOADK:; - uint8_t ix = ch->b[ip++]; + uint8_t ix = ch->bc.d[ip++]; printf("loadk #%d\t; ",ix); - Val k = ch->c[ix]; + Val k = ch->consts.d[ix]; printf("%-4s : ",typename_str(k)); println_val(k); break; |