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:
parent
72ea36112c
commit
a50ef07e16
2 changed files with 13 additions and 2 deletions
|
@ -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>
|
||||
|
||||
* eval.c (rb_longjmp): source file information may be NULL.
|
||||
|
|
|
@ -305,8 +305,14 @@ remove_method(VALUE klass, ID mid)
|
|||
if (mid == object_id || mid == __send || mid == __send_bang || mid == init) {
|
||||
rb_warn("removing `%s' may cause serious problem", rb_id2name(mid));
|
||||
}
|
||||
if (!st_delete(RCLASS(klass)->m_tbl, &mid, &data) ||
|
||||
!(body = (NODE *)data) || !body->nd_body) {
|
||||
if (st_lookup(RCLASS(klass)->m_tbl, mid, &data)) {
|
||||
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_id2name(mid), rb_class2name(klass));
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue