summaryrefslogtreecommitdiff
path: root/dis.c
diff options
context:
space:
mode:
authorubq323 <ubq323@ubq323.website>2024-06-20 16:00:34 +0100
committerubq323 <ubq323@ubq323.website>2024-06-20 16:00:34 +0100
commit60b3369ab24f9bd2a4a6d638ab1b3013ebc29814 (patch)
tree3ff8ec7e95ef314266673b1b3d7bedb880a4a5b0 /dis.c
parent9ee73a8459eb2bb58adc29da02de312b7e4e7dca (diff)
pass State *S everywhere
contains changes from a million years ago that i don't remember much about
Diffstat (limited to 'dis.c')
-rw-r--r--dis.c8
1 files changed, 4 insertions, 4 deletions
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;