diff options
author | nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2001-10-16 15:17:10 +0000 |
---|---|---|
committer | nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2001-10-16 15:17:10 +0000 |
commit | 4c2d3e676eb219c20d4092e78aac9a6dc5f52e44 (patch) | |
tree | b607c63e4de536fdb1bfeb0bed6fe92c25ea04c6 /eval.c | |
parent | a6002c055c6c35cc5c2d74c8907d6fe97998979c (diff) |
* eval.c (rb_f_missing): check stack level with rb_stack_check().
* eval.c (rb_call0): ditto.
* eval.c, intern.h (rb_stack_check): added. [new]
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_6@1789 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'eval.c')
-rw-r--r-- | eval.c | 14 |
1 files changed, 11 insertions, 3 deletions
@@ -4065,6 +4065,8 @@ rb_f_missing(argc, argv, obj) rb_raise(rb_eArgError, "no id given"); } + rb_stack_check(); + id = SYM2ID(argv[0]); argc--; argv++; @@ -4189,6 +4191,14 @@ stack_length(p) #endif } +void +rb_stack_check() +{ + if (stack_length(0) > STACK_LEVEL_MAX) { + rb_raise(rb_eSysStackError, "stack level too deep"); + } +} + static VALUE call_cfunc(func, recv, len, argc, argv) VALUE (*func)(); @@ -4304,9 +4314,7 @@ rb_call0(klass, recv, id, argc, argv, body, nosuper) if ((++tick & 0xff) == 0) { CHECK_INTS; /* better than nothing */ - if (stack_length(0) > STACK_LEVEL_MAX) { - rb_raise(rb_eSysStackError, "stack level too deep"); - } + rb_stack_check(); } PUSH_ITER(itr); PUSH_FRAME(); |