diff options
author | nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2002-01-08 07:02:26 +0000 |
---|---|---|
committer | nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2002-01-08 07:02:26 +0000 |
commit | c56b86ecd21cf89edccfcc5f39d4343fc5b33449 (patch) | |
tree | 747e583dea0b747b903396eb369eb7fac1ba93be /eval.c | |
parent | b25af75ba54f62b07accc1b85f85046aee0f8581 (diff) |
* eval.c (rb_add_method): clear replaced method from the cache.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_6@1974 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'eval.c')
-rw-r--r-- | eval.c | 16 |
1 files changed, 13 insertions, 3 deletions
@@ -232,7 +232,8 @@ rb_add_method(klass, mid, node, noex) } if (OBJ_FROZEN(klass)) rb_error_frozen("class/module"); body = NEW_METHOD(node, noex); - st_insert(RCLASS(klass)->m_tbl, mid, body); + if (st_insert(RCLASS(klass)->m_tbl, mid, body)) + rb_clear_cache_by_id(mid); } static NODE* @@ -4199,8 +4200,17 @@ stack_length(p) void rb_stack_check() { - if (stack_length(0) > STACK_LEVEL_MAX) { - rb_raise(rb_eSysStackError, "stack level too deep"); + static int overflowing = 0; + if (!overflowing && stack_length(0) > STACK_LEVEL_MAX) { + int state; + overflowing = 1; + PUSH_TAG(PROT_NONE); + if ((state = EXEC_TAG()) == 0) { + rb_raise(rb_eSysStackError, "stack level too deep"); + } + POP_TAG(); + overflowing = 0; + JUMP_TAG(state); } } |