1
0
Fork 0
mirror of https://github.com/ruby/ruby.git synced 2022-11-09 12:17:21 -05:00

* eval_method.ci (remove_method): should not remove undef place

holder.  [ruby-dev:31816], [ruby-dev:31817]

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@13511 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
matz 2007-09-25 12:41:48 +00:00
parent 72ea36112c
commit a50ef07e16
2 changed files with 13 additions and 2 deletions

View file

@ -1,3 +1,8 @@
Tue Sep 25 13:43:03 2007 Yukihiro Matsumoto <matz@ruby-lang.org>
* eval_method.ci (remove_method): should not remove undef place
holder. [ruby-dev:31816], [ruby-dev:31817]
Tue Sep 25 09:51:31 2007 Yukihiro Matsumoto <matz@ruby-lang.org> Tue Sep 25 09:51:31 2007 Yukihiro Matsumoto <matz@ruby-lang.org>
* eval.c (rb_longjmp): source file information may be NULL. * eval.c (rb_longjmp): source file information may be NULL.

View file

@ -305,8 +305,14 @@ remove_method(VALUE klass, ID mid)
if (mid == object_id || mid == __send || mid == __send_bang || mid == init) { if (mid == object_id || mid == __send || mid == __send_bang || mid == init) {
rb_warn("removing `%s' may cause serious problem", rb_id2name(mid)); rb_warn("removing `%s' may cause serious problem", rb_id2name(mid));
} }
if (!st_delete(RCLASS(klass)->m_tbl, &mid, &data) || if (st_lookup(RCLASS(klass)->m_tbl, mid, &data)) {
!(body = (NODE *)data) || !body->nd_body) { body = (NODE *)data;
if (!body || !body->nd_body) body = 0;
else {
st_delete(RCLASS(klass)->m_tbl, &mid, &data);
}
}
if (!body) {
rb_name_error(mid, "method `%s' not defined in %s", rb_name_error(mid, "method `%s' not defined in %s",
rb_id2name(mid), rb_class2name(klass)); rb_id2name(mid), rb_class2name(klass));
} }