summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorshyouhei <shyouhei@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2008-06-04 10:16:19 +0000
committershyouhei <shyouhei@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2008-06-04 10:16:19 +0000
commitdfbf5ccae692c036c1ec5a513983eb339bd7dc5d (patch)
tree0c708b04db9163c3a6bc0fd8ba1ed0bc7afdff7f
parentb8eb6fded7a605982a2744a3a0fb25e740044ee8 (diff)
merge revision(s) 13586:
* eval.c (remove_method): should not remove undef place holder. [ruby-dev:31817] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_8_5@16814 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
-rw-r--r--ChangeLog5
-rw-r--r--eval.c9
-rw-r--r--version.h2
3 files changed, 13 insertions, 3 deletions
diff --git a/ChangeLog b/ChangeLog
index b95dfea..bf1de06 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -14,6 +14,11 @@ Tue Jun 3 15:27:11 2008 Nobuyoshi Nakada <nobu@ruby-lang.org>
* gc.c (os_obj_of, os_each_obj): hide objects to be finalized.
[ruby-dev:31810]
+Wed Jun 4 19:15:57 2008 Yukihiro Matsumoto <matz@ruby-lang.org>
+
+ * eval.c (remove_method): should not remove undef place holder.
+ [ruby-dev:31817]
+
Tue Jun 3 15:05:48 2008 Nobuyoshi Nakada <nobu@ruby-lang.org>
* process.c (struct rb_exec_arg): proc should be a VALUE.
diff --git a/eval.c b/eval.c
index 45b4eee..132d280 100644
--- a/eval.c
+++ b/eval.c
@@ -574,8 +574,13 @@ remove_method(klass, mid)
if (mid == __id__ || mid == __send__ || mid == init) {
rb_warn("removing `%s' may cause serious problem", rb_id2name(mid));
}
- if (!st_delete(RCLASS(klass)->m_tbl, &mid, (st_data_t *)&body) ||
- !body->nd_body) {
+ if (st_lookup(RCLASS(klass)->m_tbl, mid, (st_data_t *)&body)) {
+ if (!body || !body->nd_body) body = 0;
+ else {
+ st_delete(RCLASS(klass)->m_tbl, &mid, (st_data_t *)&body);
+ }
+ }
+ if (!body) {
rb_name_error(mid, "method `%s' not defined in %s",
rb_id2name(mid), rb_class2name(klass));
}
diff --git a/version.h b/version.h
index c1a2ff8..46aa14a 100644
--- a/version.h
+++ b/version.h
@@ -2,7 +2,7 @@
#define RUBY_RELEASE_DATE "2008-06-04"
#define RUBY_VERSION_CODE 185
#define RUBY_RELEASE_CODE 20080604
-#define RUBY_PATCHLEVEL 125
+#define RUBY_PATCHLEVEL 126
#define RUBY_VERSION_MAJOR 1
#define RUBY_VERSION_MINOR 8