Skip to content

Commit 7e7f207

Browse files
authored
Modify VM functions to accept VM pointer
1 parent 80b475b commit 7e7f207

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

src/proxpl_api.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -44,11 +44,11 @@ static char* readFile(const char* path) {
4444
void proxpl_vm_init(VM *vm) {
4545
// Standard CLOX uses a global VM instance, so we ignore the pointer for now
4646
// or assume 'vm' points to the global one.
47-
initVM();
47+
initVM(vm);
4848
}
4949

5050
void proxpl_vm_free(VM *vm) {
51-
freeVM();
51+
freeVM(vm);
5252
}
5353

5454
InterpretResult proxpl_interpret_chunk(VM *vm, const Chunk *chunk) {
@@ -63,7 +63,7 @@ InterpretResult proxpl_interpret_file(VM *vm, const char *path) {
6363
if (source == NULL) return INTERPRET_COMPILE_ERROR;
6464

6565
// Pass the source string to interpret
66-
InterpretResult result = interpret(source);
66+
InterpretResult result = interpret(vm, source);
6767

6868
free(source);
6969
return result;

0 commit comments

Comments
 (0)