diff options
Diffstat (limited to 'src/bytecode/main.c')
-rwxr-xr-x | src/bytecode/main.c | 11 |
1 files changed, 5 insertions, 6 deletions
diff --git a/src/bytecode/main.c b/src/bytecode/main.c index e4cf643..7cb0a2a 100755 --- a/src/bytecode/main.c +++ b/src/bytecode/main.c | |||
@@ -45,27 +45,26 @@ process_source(const StringView *source) { | |||
45 | } | 45 | } |
46 | 46 | ||
47 | // Compile chunk. | 47 | // Compile chunk. |
48 | Object main = compile(tokens); | 48 | Chunk *main = compile(tokens); |
49 | if (errors_n != 0) { | 49 | if (errors_n != 0) { |
50 | object_free(main); | 50 | chunk_free(main); |
51 | array_free(tokens); | 51 | array_free(tokens); |
52 | return; | 52 | return; |
53 | } | 53 | } |
54 | 54 | ||
55 | #ifdef DEBUG | 55 | #ifdef DEBUG |
56 | disassemble_chunk(main.chunk); | 56 | disassemble_chunk(main); |
57 | #endif | 57 | #endif |
58 | 58 | ||
59 | // Interpret chunk. | 59 | // Interpret chunk. |
60 | CallFrame frame = (CallFrame){ | 60 | CallFrame frame = (CallFrame){ |
61 | .procedure = main, | 61 | .chunk = main, |
62 | .pc = main.chunk->code, | ||
63 | }; | 62 | }; |
64 | array_push(vm.frames, frame); | 63 | array_push(vm.frames, frame); |
65 | vm_interpret(&vm); | 64 | vm_interpret(&vm); |
66 | 65 | ||
67 | // Free resources. | 66 | // Free resources. |
68 | object_free(main); | 67 | chunk_free(main); |
69 | array_free(tokens); | 68 | array_free(tokens); |
70 | } | 69 | } |
71 | 70 | ||