aboutsummaryrefslogtreecommitdiffstats
path: root/clox/src/vm.c
diff options
context:
space:
mode:
Diffstat (limited to 'clox/src/vm.c')
-rw-r--r--clox/src/vm.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/clox/src/vm.c b/clox/src/vm.c
index 49a162d..c1c6941 100644
--- a/clox/src/vm.c
+++ b/clox/src/vm.c
@@ -211,6 +211,11 @@ static InterpretResult run() {
vm.ip += offset;
break;
}
+ case OP_LOOP: {
+ uint16_t offset = READ_SHORT();
+ vm.ip -= offset;
+ break;
+ }
case OP_RETURN: {
/* The book said to remove this, but when I do I get an infinite loop and
then a segfault because it keeps trying to add the constant 1 to the