diff options
author | ko1 <ko1@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2007-09-26 10:39:49 +0000 |
---|---|---|
committer | ko1 <ko1@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2007-09-26 10:39:49 +0000 |
commit | 67aa07f44d40e5e67081c6e8fef5af49caee1525 (patch) | |
tree | 3137398e82d7e8c97285735f23cb4f7d8e96df8c /eval_intern.h | |
parent | 94331261e94b15fe06df26ec78668480c17537f5 (diff) | |
download | ruby-67aa07f44d40e5e67081c6e8fef5af49caee1525.tar.gz |
* eval.c (eval): fix to check stack overflow.
* eval_intern.h, vm.h: move CHECK_STACK_OVERFLOW() macro.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@13521 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'eval_intern.h')
-rw-r--r-- | eval_intern.h | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/eval_intern.h b/eval_intern.h index 3f4c81bf48..e5680a2731 100644 --- a/eval_intern.h +++ b/eval_intern.h @@ -186,6 +186,12 @@ char *strrchr _((const char *, const char)); ruby_cref()->nd_visi = (f); \ } +#define CHECK_STACK_OVERFLOW(cfp, margin) do \ + if (((VALUE *)(cfp)->sp) + (margin) >= ((VALUE *)cfp)) { \ + rb_exc_raise(sysstack_error); \ + } \ +while (0) + void rb_thread_cleanup _((void)); void rb_thread_wait_other_threads _((void)); |