Skip to content

Commit 5f632c9

Browse files
authored
Update vm.c
1 parent 7f3f9c3 commit 5f632c9

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

vm.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -126,8 +126,8 @@ bool values_equal(Value a, Value b) {
126126

127127
Value peek(int offset) {
128128
VM* vm;
129-
if (vm->stack_top - offset - 1 < 0) {
129+
if ((intptr_t) (vm->stack_top - offset - 1) < 0) {
130130
printf("Stack underflow!");
131131
}
132-
return vm->stack[vm->stack_top - offset - 1];
132+
return vm->stack[(int) (vm->stack_top - offset - 1)];
133133
}

0 commit comments

Comments
 (0)