diff options
author | ubq323 <ubq323@ubq323.website> | 2024-06-29 13:12:34 +0100 |
---|---|---|
committer | ubq323 <ubq323@ubq323.website> | 2024-06-29 13:12:34 +0100 |
commit | 83382cb1b46eb17f94f16fbbf05b5e471284d797 (patch) | |
tree | 73e8124725984a8c883c158ae50e61693924df9f /dis.c | |
parent | b51136defc2898c868e4a1b60025d5bb57347662 (diff) |
add proper tail calls
Diffstat (limited to 'dis.c')
-rw-r--r-- | dis.c | 6 |
1 files changed, 5 insertions, 1 deletions
@@ -60,6 +60,11 @@ static size_t disasm_instr_h(Chunk *ch, size_t ip, int depth) { printf("call #%hhu\n",nargs); break; } + case OP_TAILCALL: { + uint8_t nargs = ch->bc.d[ip++]; + printf("\033[31mtailcall\033[0m #%hhu\n",nargs); + break; + } case OP_ENDSCOPE: { uint8_t nlocals = ch->bc.d[ip++]; printf("endscope #%hhu\n",nlocals); @@ -107,7 +112,6 @@ static size_t disasm_instr_h(Chunk *ch, size_t ip, int depth) { default: printf("unknown opcode %d\n", instr); - exit(2); } |