aboutsummaryrefslogtreecommitdiffstats
path: root/vm.h
diff options
context:
space:
mode:
Diffstat (limited to 'vm.h')
-rw-r--r--vm.h6
1 files changed, 6 insertions, 0 deletions
diff --git a/vm.h b/vm.h
index b1c543eb9c..855efeae06 100644
--- a/vm.h
+++ b/vm.h
@@ -220,6 +220,12 @@ default: \
((rb_control_frame_t *)(th->stack + th->stack_size) - (rb_control_frame_t *)(cfp))
#define VM_SP_CNT(th, sp) ((sp) - (th)->stack)
+#define CHECK_STACK_OVERFLOW(cfp, margin) do \
+ if (((VALUE *)(cfp)->sp) + (margin) >= ((VALUE *)cfp)) { \
+ rb_exc_raise(sysstack_error); \
+ } \
+while (0)
+
/*
env{
env[0] // special (block or prev env)