[前][次][番号順一覧][スレッド一覧]

ruby-changes:2473

From: ko1@a...
Date: 19 Nov 2007 02:44:22 +0900
Subject: [ruby-changes:2473] nobu - Ruby:r13964 (trunk): * compile.c (iseq_compile_each): alias and undef accept dsyms as well

nobu	2007-11-19 02:44:09 +0900 (Mon, 19 Nov 2007)

  New Revision: 13964

  Modified files:
    trunk/ChangeLog
    trunk/compile.c

  Log:
    * compile.c (iseq_compile_each): alias and undef accept dsyms as well
      as literals.  [ruby-dev:32308]


  http://svn.ruby-lang.org/cgi-bin/viewvc.cgi/trunk/compile.c?r1=13964&r2=13963
  http://svn.ruby-lang.org/cgi-bin/viewvc.cgi/trunk/ChangeLog?r1=13964&r2=13963

Index: ChangeLog
===================================================================
--- ChangeLog	(revision 13963)
+++ ChangeLog	(revision 13964)
@@ -1,3 +1,8 @@
+Mon Nov 19 02:44:07 2007  Nobuyoshi Nakada  <nobu@r...>
+
+	* compile.c (iseq_compile_each): alias and undef accept dsyms as well
+	  as literals.  [ruby-dev:32308]
+
 Mon Nov 19 02:31:36 2007  Nobuyoshi Nakada  <nobu@r...>
 
 	* eval_method.ci (rb_add_method): no redefinition warning for undef.
Index: compile.c
===================================================================
--- compile.c	(revision 13963)
+++ compile.c	(revision 13964)
@@ -4067,10 +4067,11 @@
       }
       case NODE_ALIAS:{
 	VALUE s1, s2;
+	enum node_type t;
 
-	if (nd_type(node->u1.node) != NODE_LIT ||
-	    nd_type(node->u2.node) != NODE_LIT) {
-	    rb_bug("alias args must be NODE_LIT");
+	if (((t = nd_type(node->u1.node)) != NODE_LIT && t != NODE_DSYM) ||
+	    ((t = nd_type(node->u2.node)) != NODE_LIT && t != NODE_DSYM)) {
+	    rb_compile_bug(ERROR_ARGS "alias args must be NODE_LIT or NODE_DSYM");
 	}
 	s1 = node->u1.node->nd_lit;
 	s2 = node->u2.node->nd_lit;
@@ -4091,8 +4092,9 @@
 	break;
       }
       case NODE_UNDEF:{
-	if (nd_type(node->u2.node) != NODE_LIT) {
-	    rb_bug("undef args must be NODE_LIT");
+	enum node_type t = nd_type(node->u2.node);
+	if (t != NODE_LIT && t != NODE_DSYM) {
+	    rb_compile_bug(ERROR_ARGS "undef args must be NODE_LIT");
 	}
 	ADD_INSN1(ret, nd_line(node), undef,
 		  ID2SYM(rb_to_id(node->u2.node->nd_lit)));

--
ML: ruby-changes@q...
Info: http://www.atdot.net/~ko1/quickml

[前][次][番号順一覧][スレッド一覧]