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

ruby-changes:45032

From: rhe <ko1@a...>
Date: Sat, 17 Dec 2016 17:25:39 +0900 (JST)
Subject: [ruby-changes:45032] rhe:r57105 (trunk): compile.c: do not emit numeric literal range in void context

rhe	2016-12-17 17:25:34 +0900 (Sat, 17 Dec 2016)

  New Revision: 57105

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

  Log:
    compile.c: do not emit numeric literal range in void context
    
    A fix-up for r56316. Fix stack consistency error on '1..3; nil'.

  Modified files:
    trunk/compile.c
Index: compile.c
===================================================================
--- compile.c	(revision 57104)
+++ compile.c	(revision 57105)
@@ -6001,9 +6001,11 @@ iseq_compile_each(rb_iseq_t *iseq, LINK_ https://github.com/ruby/ruby/blob/trunk/compile.c#L6001
 	NODE *b = node->nd_beg;
 	NODE *e = node->nd_end;
 	if (number_literal_p(b) && number_literal_p(e)) {
-	    VALUE val = rb_range_new(b->nd_lit, e->nd_lit, excl);
-	    iseq_add_mark_object_compile_time(iseq, val);
-	    ADD_INSN1(ret, line, putobject, val);
+	    if (!popped) {
+		VALUE val = rb_range_new(b->nd_lit, e->nd_lit, excl);
+		iseq_add_mark_object_compile_time(iseq, val);
+		ADD_INSN1(ret, line, putobject, val);
+	    }
 	    break;
 	}
 	COMPILE(ret, "min", (NODE *) node->nd_beg);

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

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