Issue #5847 has been reported by Thomas Enebo.

----------------------------------------
Bug #5847: Old Ruby 1.8 state flag for yield node appears to be unused
https://bugs.ruby-lang.org/issues/5847

Author: Thomas Enebo
Status: Open
Priority: Normal
Assignee: 
Category: 
Target version: 
ruby -v: ruby 2.0.0dev (2012-01-05 trunk 34217) [x86_64-darwin11.2.0]


This seems to be unused by compile.c. The logic in parse.y seems dead (in both 1.9.3 and 2.0.0 trunk):

diff --git a/node.h b/node.h
index be91a31..0bef26f 100644
--- a/node.h
+++ b/node.h
@@ -376,7 +376,7 @@ typedef struct RNode {
 #define NEW_RESBODY(a,ex,n) NEW_NODE(NODE_RESBODY,n,ex,a)
 #define NEW_ENSURE(b,en) NEW_NODE(NODE_ENSURE,b,0,en)
 #define NEW_RETURN(s) NEW_NODE(NODE_RETURN,s,0,0)
-#define NEW_YIELD(a,s) NEW_NODE(NODE_YIELD,a,0,s)
+#define NEW_YIELD(a) NEW_NODE(NODE_YIELD,a,0,0)
 #define NEW_LIST(a)  NEW_ARRAY(a)
 #define NEW_ARRAY(a) NEW_NODE(NODE_ARRAY,a,1,0)
 #define NEW_ZARRAY() NEW_NODE(NODE_ZARRAY,0,0,0)
diff --git a/parse.y b/parse.y
index 8ee7cdb..3bab75b 100644
--- a/parse.y
+++ b/parse.y
@@ -2753,7 +2753,7 @@ primary		: literal
 		| keyword_yield '(' rparen
 		    {
 		    /*%%%*/
-			$$ = NEW_YIELD(0, Qfalse);
+			$$ = NEW_YIELD(0);
 		    /*%
 			$$ = dispatch1(yield, dispatch1(paren, arg_new()));
 		    %*/
@@ -2761,7 +2761,7 @@ primary		: literal
 		| keyword_yield
 		    {
 		    /*%%%*/
-			$$ = NEW_YIELD(0, Qfalse);
+			$$ = NEW_YIELD(0);
 		    /*%
 			$$ = dispatch0(yield0);
 		    %*/
@@ -9605,18 +9605,9 @@ ret_args_gen(struct parser_params *parser, NODE *node)
 static NODE *
 new_yield_gen(struct parser_params *parser, NODE *node)
 {
-    long state = Qtrue;
+    if (node) no_blockarg(parser, node);
 
-    if (node) {
-        no_blockarg(parser, node);
-	if (node && nd_type(node) == NODE_SPLAT) {
-	    state = Qtrue;
-	}
-    }
-    else {
-        state = Qfalse;
-    }
-    return NEW_YIELD(node, state);
+    return NEW_YIELD(node);
 }
 
 static NODE*


-- 
http://redmine.ruby-lang.org