summaryrefslogtreecommitdiff
path: root/eval_method.h
diff options
context:
space:
mode:
authorko1 <ko1@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2007-01-05 05:24:48 +0000
committerko1 <ko1@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2007-01-05 05:24:48 +0000
commitd880d4382ffca5a9deb083ba0acc69dfa5f5d306 (patch)
treed7b2028240d42274834ff37a838d08ef3dff33c3 /eval_method.h
parentc5bd0c8e3bf602e082cfd8f95bc28b06aeea2694 (diff)
* eval_method.h (rb_add_method) : fix to check old_node
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@11478 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'eval_method.h')
-rw-r--r--eval_method.h6
1 files changed, 3 insertions, 3 deletions
diff --git a/eval_method.h b/eval_method.h
index 59e7cef8dc..7f2c99d1ff 100644
--- a/eval_method.h
+++ b/eval_method.h
@@ -146,13 +146,13 @@ rb_add_method(VALUE klass, ID mid, NODE * node, int noex)
if (nd_type(old_node->nd_body->nd_body) == NODE_CFUNC) {
yarv_check_redefinition_opt_method(old_node);
}
+ if (RTEST(ruby_verbose) && old_node->nd_cnt == 0 && old_node->nd_body) {
+ rb_warning("method redefined; discarding old %s", rb_id2name(mid));
+ }
}
if (klass == rb_cObject && node->nd_mid == init) {
rb_warn("redefining Object#initialize may cause infinite loop");
}
- if (RTEST(ruby_verbose) && old_node->nd_cnt == 0 && old_node->nd_body) {
- rb_warning("method redefined; discarding old %s", rb_id2name(mid));
- }
}
if (mid == object_id || mid == __send || mid == __send_bang) {