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

ruby-changes:34568

From: charliesome <ko1@a...>
Date: Wed, 2 Jul 2014 03:21:30 +0900 (JST)
Subject: [ruby-changes:34568] charliesome:r46649 (trunk): Fix --dump=parsetree segfault on required keyword argument

charliesome	2014-07-02 03:21:22 +0900 (Wed, 02 Jul 2014)

  New Revision: 46649

  http://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=revision&revision=46649

  Log:
    Fix --dump=parsetree segfault on required keyword argument
    
    * node.c (dump_node): handle nd_value == (NODE *)-1 to mean this
      keyword argument is required

  Modified files:
    trunk/ChangeLog
    trunk/node.c
Index: ChangeLog
===================================================================
--- ChangeLog	(revision 46648)
+++ ChangeLog	(revision 46649)
@@ -1,3 +1,8 @@ https://github.com/ruby/ruby/blob/trunk/ChangeLog#L1
+Wed Jul  2 03:20:00 2014  Charlie Somerville  <charliesome@r...>
+
+	* node.c (dump_node): handle nd_value == (NODE *)-1 to mean this
+	  keyword argument is required
+
 Wed Jul  2 02:57:27 2014  Nobuyoshi Nakada  <nobu@r...>
 
 	* vm.c (rb_vm_env_local_variables): returns array of local
Index: node.c
===================================================================
--- node.c	(revision 46648)
+++ node.c	(revision 46649)
@@ -300,7 +300,12 @@ dump_node(VALUE buf, VALUE indent, int c https://github.com/ruby/ruby/blob/trunk/node.c#L300
       asgn:
 	F_ID(nd_vid, "variable");
 	LAST_NODE;
-	F_NODE(nd_value, "rvalue");
+	if (node->nd_value == (NODE *)-1) {
+	    F_MSG(nd_value, "rvalue", "(required keyword argument)");
+	}
+	else {
+	    F_NODE(nd_value, "rvalue");
+	}
 	break;
 
       case NODE_GASGN:

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

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