Fix usage of short-named constants. (ruby svn r18485)

From msf@.
This commit is contained in:
bernd 2009-01-31 09:54:31 +00:00
parent 253253eb9f
commit bf613b4177
4 changed files with 59 additions and 2 deletions

View File

@ -1,4 +1,4 @@
# $OpenBSD: Makefile,v 1.63 2008/09/28 15:43:05 bernd Exp $
# $OpenBSD: Makefile,v 1.64 2009/01/31 09:54:31 bernd Exp $
SHARED_ONLY= Yes
@ -11,7 +11,7 @@ VERSION= 1.8.6
PATCHLEVEL= 287
DISTNAME= ruby-${VERSION}-p${PATCHLEVEL}
SHARED_LIBS= ruby 2.0
PKGNAME-main= ruby-${VERSION}.${PATCHLEVEL}
PKGNAME-main= ruby-${VERSION}.${PATCHLEVEL}p0
PKGNAME-iconv= ruby-iconv-${VERSION}.${PATCHLEVEL}
PKGNAME-gdbm= ruby-gdbm-${VERSION}.${PATCHLEVEL}
PKGNAME-tk= ruby-tk-${VERSION}.${PATCHLEVEL}

View File

@ -0,0 +1,21 @@
$OpenBSD: patch-class_c,v 1.1 2009/01/31 09:54:31 bernd Exp $
Fix usage of short-named constants.
http://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=rev&revision=18485
https://bugs.launchpad.net/ubuntu/+source/ruby1.8/+bug/282302
--- class.c.orig Sat Jun 28 12:27:21 2008
+++ class.c Tue Jan 27 09:46:14 2009
@@ -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;

View File

@ -0,0 +1,18 @@
$OpenBSD: patch-eval_c,v 1.3 2009/01/31 09:54:31 bernd Exp $
Fix usage of short-named constants.
http://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=rev&revision=18485
https://bugs.launchpad.net/ubuntu/+source/ruby1.8/+bug/282302
--- eval.c.orig Mon Aug 4 05:16:55 2008
+++ eval.c Tue Jan 27 09:46:14 2009
@@ -1066,7 +1066,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 { \

View File

@ -0,0 +1,18 @@
$OpenBSD: patch-node_h,v 1.1 2009/01/31 09:54:31 bernd Exp $
Fix usage of short-named constants.
http://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=rev&revision=18485
https://bugs.launchpad.net/ubuntu/+source/ruby1.8/+bug/282302
--- node.h.orig Mon Jul 7 08:01:50 2008
+++ node.h Tue Jan 27 09:46:14 2009
@@ -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)