From dbca60fd2323e2f7f0b01e956dae67c0107dec44 Mon Sep 17 00:00:00 2001 From: Tom Willemse Date: Fri, 12 Aug 2022 22:41:06 -0700 Subject: [PATCH] Fix bug with running code --- clox/src/vm.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/clox/src/vm.c b/clox/src/vm.c index 37bf2d4..5373b75 100644 --- a/clox/src/vm.c +++ b/clox/src/vm.c @@ -399,7 +399,7 @@ static InterpretResult run() { InterpretResult interpret(const char *source) { ObjFunction *function = compile(source); - if (function != NULL) + if (function == NULL) return INTERPRET_COMPILE_ERROR; push(OBJ_VAL(function));