From 60b3369ab24f9bd2a4a6d638ab1b3013ebc29814 Mon Sep 17 00:00:00 2001 From: ubq323 Date: Thu, 20 Jun 2024 16:00:34 +0100 Subject: pass State *S everywhere contains changes from a million years ago that i don't remember much about --- dis.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'dis.c') diff --git a/dis.c b/dis.c index 0eb2720..6ba934d 100644 --- a/dis.c +++ b/dis.c @@ -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; -- cgit v1.2.3