diff --git a/src/vm.c b/src/vm.c index c8ef10a9..564c44b2 100644 --- a/src/vm.c +++ b/src/vm.c @@ -1,4 +1,5 @@ #include +#include #include #include #include @@ -301,7 +302,7 @@ pic_apply_argv(pic_state *pic, struct pic_proc *proc, size_t argc, ...) # define VM_LOOP_END } } #endif -#define PUSH(v) (*pic->sp++ = (v)) +#define PUSH(v) ((pic->sp >= pic->stend) ? abort() : (*pic->sp++ = (v))) #define POP() (*--pic->sp) #define POPN(i) (pic->sp -= (i))