summaryrefslogtreecommitdiff
path: root/eval.c
diff options
context:
space:
mode:
authornobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2002-01-08 07:02:26 +0000
committernobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2002-01-08 07:02:26 +0000
commit1a101d775a8c42f36c5a16978914ae2ac070e8a4 (patch)
treec63d0e66d2eecf6a07d782bf9a26154dbe92b62f /eval.c
parentdcbb422253ebd766d44810ab17b8705d04297ccf (diff)
* eval.c (rb_add_method): clear replaced method from the cache.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@1974 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'eval.c')
-rw-r--r--eval.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/eval.c b/eval.c
index d791b31f86..f5fbd5c91b 100644
--- a/eval.c
+++ b/eval.c
@@ -229,7 +229,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*