summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorshyouhei <shyouhei@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2009-01-16 02:00:48 (GMT)
committershyouhei <shyouhei@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2009-01-16 02:00:48 (GMT)
commit78c5478af83453c7ef1bdfec001aace7437d9c1b (patch)
treef695829999d8dc8cd7d06471afefc8b77561cc4d
parent3c848f79b7eb5ad26b57c4d9edde577cc1ba7026 (diff)
merge revision(s) 18485:
* class.c (clone_method): should copy cbase in cref as well. [ruby-dev:35116] * node.h (NEW_CREF): new NEW_ macro. * eval.c (PUSH_CREF): use NEW_CREF(). git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_8_7@21585 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
-rw-r--r--ChangeLog9
-rw-r--r--class.c5
-rw-r--r--eval.c2
-rw-r--r--node.h2
-rw-r--r--version.h8
5 files changed, 19 insertions, 7 deletions
diff --git a/ChangeLog b/ChangeLog
index d98cfcc..6a696e5 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,12 @@
+Fri Jan 16 10:59:31 2009 Yukihiro Matsumoto <matz@ruby-lang.org>
+
+ * class.c (clone_method): should copy cbase in cref as well.
+ [ruby-dev:35116]
+
+ * node.h (NEW_CREF): new NEW_ macro.
+
+ * eval.c (PUSH_CREF): use NEW_CREF().
+
Thu Jan 15 14:34:32 2009 Nobuyoshi Nakada <nobu@ruby-lang.org>
* gc.c (STACK_LEVEL_MAX, ruby_stack_length): returns size_t.
diff --git a/class.c b/class.c
index 096c7fb..80f57a1 100644
--- a/class.c
+++ b/class.c
@@ -62,7 +62,10 @@ clone_method(mid, body, data)
NODE *fbody = body->nd_body;
if (fbody && nd_type(fbody) == NODE_SCOPE) {
- fbody = rb_copy_node_scope(fbody, ruby_cref);
+ NODE *cref = (NODE*)fbody->nd_rval;
+
+ if (cref) cref = cref->nd_next;
+ fbody = rb_copy_node_scope(fbody, NEW_CREF(data->klass, cref));
}
st_insert(data->tbl, mid, (st_data_t)NEW_METHOD(fbody, body->nd_noex));
return ST_CONTINUE;
diff --git a/eval.c b/eval.c
index 1df4d28..e9da97f 100644
--- a/eval.c
+++ b/eval.c
@@ -1065,7 +1065,7 @@ static VALUE ruby_wrapper; /* security wrapper */
NODE *ruby_cref = 0;
NODE *ruby_top_cref;
-#define PUSH_CREF(c) ruby_cref = NEW_NODE(NODE_CREF,(c),0,ruby_cref)
+#define PUSH_CREF(c) ruby_cref = NEW_CREF(c,ruby_cref)
#define POP_CREF() ruby_cref = ruby_cref->nd_next
#define PUSH_SCOPE() do { \
diff --git a/node.h b/node.h
index ec16feb..edc24b2 100644
--- a/node.h
+++ b/node.h
@@ -319,7 +319,7 @@ extern NODE *ruby_top_cref;
#define NEW_MODULE(n,b) NEW_NODE(NODE_MODULE,n,NEW_SCOPE(b),0)
#define NEW_COLON2(c,i) NEW_NODE(NODE_COLON2,c,i,0)
#define NEW_COLON3(i) NEW_NODE(NODE_COLON3,0,i,0)
-#define NEW_CREF(c) (NEW_NODE(NODE_CREF,0,0,c))
+#define NEW_CREF(c,n) NEW_NODE(NODE_CREF,c,0,n)
#define NEW_DOT2(b,e) NEW_NODE(NODE_DOT2,b,e,0)
#define NEW_DOT3(b,e) NEW_NODE(NODE_DOT3,b,e,0)
#define NEW_ATTRSET(a) NEW_NODE(NODE_ATTRSET,a,0,0)
diff --git a/version.h b/version.h
index 57c62e2..286e716 100644
--- a/version.h
+++ b/version.h
@@ -1,15 +1,15 @@
#define RUBY_VERSION "1.8.7"
-#define RUBY_RELEASE_DATE "2009-01-15"
+#define RUBY_RELEASE_DATE "2009-01-16"
#define RUBY_VERSION_CODE 187
-#define RUBY_RELEASE_CODE 20090115
-#define RUBY_PATCHLEVEL 86
+#define RUBY_RELEASE_CODE 20090116
+#define RUBY_PATCHLEVEL 87
#define RUBY_VERSION_MAJOR 1
#define RUBY_VERSION_MINOR 8
#define RUBY_VERSION_TEENY 7
#define RUBY_RELEASE_YEAR 2009
#define RUBY_RELEASE_MONTH 1
-#define RUBY_RELEASE_DAY 15
+#define RUBY_RELEASE_DAY 16
#ifdef RUBY_EXTERN
RUBY_EXTERN const char ruby_version[];