diff options
author | ko1 <ko1@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2012-12-25 09:57:07 +0000 |
---|---|---|
committer | ko1 <ko1@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2012-12-25 09:57:07 +0000 |
commit | 270fbd9c058fc2a36dc7c44243f4a20c91143481 (patch) | |
tree | 2b4e01d852c06c74929382349356d0f902eae70d /vm_core.h | |
parent | febab308c87f721d9b7491d37e345d0130a4bca2 (diff) | |
download | ruby-270fbd9c058fc2a36dc7c44243f4a20c91143481.tar.gz |
* vm_core.h, eval_intern.h (CHECK_STACK_OVERFLOW): move
CHECK_STACK_OVERFLOW() to vm_core.h and rename to
CHECK_VM_STACK_OVERFLOW().
This change is only move and rename.
* tool/instruction.rb: catch up above changes.
* vm.c, vm_insnhelper.c: ditto.
* vm_insnhelper.c (vm_stackoverflow): add a function to unify
raising vm stackoverflow exception.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@38594 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'vm_core.h')
-rw-r--r-- | vm_core.h | 6 |
1 files changed, 6 insertions, 0 deletions
@@ -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 |