summaryrefslogtreecommitdiff
path: root/vm_core.h
diff options
context:
space:
mode:
Diffstat (limited to 'vm_core.h')
-rw-r--r--vm_core.h6
1 files changed, 6 insertions, 0 deletions
diff --git a/vm_core.h b/vm_core.h
index 91b8ea7bf0..48f887c03a 100644
--- a/vm_core.h
+++ b/vm_core.h
@@ -853,6 +853,12 @@ int rb_autoloading_value(VALUE mod, ID id, VALUE* value);
#define sysstack_error GET_VM()->special_exceptions[ruby_error_sysstack]
+#define CHECK_VM_STACK_OVERFLOW(cfp, margin) do \
+ if ((VALUE *)((char *)(((VALUE *)(cfp)->sp) + (margin)) + sizeof(rb_control_frame_t)) >= ((VALUE *)(cfp))) { \
+ vm_stackoverflow(); \
+ } \
+while (0)
+
/* for thread */
#if RUBY_VM_THREAD_MODEL == 2