ruby-changes:12739
From: yugui <ko1@a...>
Date: Sun, 9 Aug 2009 15:50:02 +0900 (JST)
Subject: [ruby-changes:12739] Ruby:r24451 (ruby_1_9_1): merges r24323 from trunk into ruby_1_9_1.
yugui 2009-08-08 19:56:25 +0900 (Sat, 08 Aug 2009) New Revision: 24451 http://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=rev&revision=24451 Log: merges r24323 from trunk into ruby_1_9_1. -- * compile.c (iseq_compile_each): fix stack consistency error. [ruby-core:24611] * bootstraptest/test_method.rb: add tests for above. Modified files: branches/ruby_1_9_1/ChangeLog branches/ruby_1_9_1/bootstraptest/test_method.rb branches/ruby_1_9_1/compile.c branches/ruby_1_9_1/version.h Index: ruby_1_9_1/ChangeLog =================================================================== --- ruby_1_9_1/ChangeLog (revision 24450) +++ ruby_1_9_1/ChangeLog (revision 24451) @@ -1,3 +1,10 @@ +Thu Jul 30 21:39:42 2009 Yusuke Endoh <mame@t...> + + * compile.c (iseq_compile_each): fix stack consistency error. + [ruby-core:24611] + + * bootstraptest/test_method.rb: add tests for above. + Thu Jul 30 16:45:39 2009 Nobuyoshi Nakada <nobu@r...> * insns.def (defineclass): preserve encoding of class/module Index: ruby_1_9_1/bootstraptest/test_method.rb =================================================================== --- ruby_1_9_1/bootstraptest/test_method.rb (revision 24450) +++ ruby_1_9_1/bootstraptest/test_method.rb (revision 24451) @@ -1151,3 +1151,13 @@ e.message == "undefined method `lalala!' for \"a\":String" ? :ok : :ng end }, '[ruby-core:22298]' + +assert_equal 'ok', %q{ + "hello"[0] ||= "H" + "ok" +} + +assert_equal 'ok', %q{ + "hello"[0, 1] ||= "H" + "ok" +} Index: ruby_1_9_1/compile.c =================================================================== --- ruby_1_9_1/compile.c (revision 24450) +++ ruby_1_9_1/compile.c (revision 24451) @@ -3804,12 +3804,8 @@ } ADD_INSNL(ret, nd_line(node), jump, lfin); ADD_LABEL(ret, label); - if (id == 0 || id == 1) { /* 0: or, 1: and */ - ADD_INSN(ret, nd_line(node), swap); - ADD_INSN(ret, nd_line(node), pop); - ADD_INSN(ret, nd_line(node), swap); - ADD_INSN(ret, nd_line(node), pop); - } + ADD_INSN1(ret, nd_line(node), setn, INT2FIX(FIX2INT(argc) + 1)); + ADD_INSN1(ret, nd_line(node), adjuststack, INT2FIX(FIX2INT(argc) + 1)); ADD_LABEL(ret, lfin); } else { Index: ruby_1_9_1/version.h =================================================================== --- ruby_1_9_1/version.h (revision 24450) +++ ruby_1_9_1/version.h (revision 24451) @@ -1,5 +1,5 @@ #define RUBY_VERSION "1.9.1" -#define RUBY_PATCHLEVEL 256 +#define RUBY_PATCHLEVEL 257 #define RUBY_VERSION_MAJOR 1 #define RUBY_VERSION_MINOR 9 #define RUBY_VERSION_TEENY 1 -- ML: ruby-changes@q... Info: http://www.atdot.net/~ko1/quickml/