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

ruby-changes:28260

From: nagachika <ko1@a...>
Date: Tue, 16 Apr 2013 00:29:04 +0900 (JST)
Subject: [ruby-changes:28260] nagachika:r40312 (ruby_2_0_0): merge revision(s) 40124: [Backport #8220]

nagachika	2013-04-16 00:28:52 +0900 (Tue, 16 Apr 2013)

  New Revision: 40312

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

  Log:
    merge revision(s) 40124: [Backport #8220]
    
    * compile.c (iseq_compile_each): fix of defined? with empty
      expression.  [ruby-core:53999] [Bug #8220]

  Modified directories:
    branches/ruby_2_0_0/
  Modified files:
    branches/ruby_2_0_0/ChangeLog
    branches/ruby_2_0_0/compile.c
    branches/ruby_2_0_0/test/ruby/test_syntax.rb
    branches/ruby_2_0_0/version.h

Index: ruby_2_0_0/ChangeLog
===================================================================
--- ruby_2_0_0/ChangeLog	(revision 40311)
+++ ruby_2_0_0/ChangeLog	(revision 40312)
@@ -1,3 +1,8 @@ https://github.com/ruby/ruby/blob/trunk/ruby_2_0_0/ChangeLog#L1
+Tue Apr 16 00:27:56 2013  Nobuyoshi Nakada  <nobu@r...>
+
+	* compile.c (iseq_compile_each): fix of defined? with empty
+	  expression.  [ruby-core:53999] [Bug #8220]
+
 Mon Apr 15 23:19:35 2013  Nobuyoshi Nakada  <nobu@r...>
 
 	* ext/curses/curses.c (Init_curses): fix implementation function,
Index: ruby_2_0_0/compile.c
===================================================================
--- ruby_2_0_0/compile.c	(revision 40311)
+++ ruby_2_0_0/compile.c	(revision 40312)
@@ -5161,7 +5161,12 @@ iseq_compile_each(rb_iseq_t *iseq, LINK_ https://github.com/ruby/ruby/blob/trunk/ruby_2_0_0/compile.c#L5161
 	break;
       }
       case NODE_DEFINED:{
-	if (!poped) {
+	if (poped) break;
+	if (!node->nd_head) {
+	    VALUE str = rb_iseq_defined_string(DEFINED_NIL);
+	    ADD_INSN1(ret, nd_line(node), putobject, str);
+	}
+	else {
 	    LABEL *lfinish[2];
 	    lfinish[0] = NEW_LABEL(line);
 	    lfinish[1] = 0;
Index: ruby_2_0_0/version.h
===================================================================
--- ruby_2_0_0/version.h	(revision 40311)
+++ ruby_2_0_0/version.h	(revision 40312)
@@ -1,10 +1,10 @@ https://github.com/ruby/ruby/blob/trunk/ruby_2_0_0/version.h#L1
 #define RUBY_VERSION "2.0.0"
-#define RUBY_RELEASE_DATE "2013-04-15"
-#define RUBY_PATCHLEVEL 137
+#define RUBY_RELEASE_DATE "2013-04-16"
+#define RUBY_PATCHLEVEL 138
 
 #define RUBY_RELEASE_YEAR 2013
 #define RUBY_RELEASE_MONTH 4
-#define RUBY_RELEASE_DAY 15
+#define RUBY_RELEASE_DAY 16
 
 #include "ruby/version.h"
 
Index: ruby_2_0_0/test/ruby/test_syntax.rb
===================================================================
--- ruby_2_0_0/test/ruby/test_syntax.rb	(revision 40311)
+++ ruby_2_0_0/test/ruby/test_syntax.rb	(revision 40312)
@@ -10,6 +10,11 @@ class TestSyntax < Test::Unit::TestCase https://github.com/ruby/ruby/blob/trunk/ruby_2_0_0/test/ruby/test_syntax.rb#L10
     end
   end
 
+  def test_defined_empty_argument
+    bug8220 = '[ruby-core:53999] [Bug #8220]'
+    assert_ruby_status(%w[--disable-gem], 'puts defined? ()', bug8220)
+  end
+
   def test_must_ascii_compatible
     require 'tempfile'
     f = Tempfile.new("must_ac_")

Property changes on: ruby_2_0_0
___________________________________________________________________
Modified: svn:mergeinfo
   Merged /trunk:r40124


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

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