summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--ChangeLog7
-rw-r--r--bootstraptest/test_literal.rb2
-rw-r--r--insns.def26
-rw-r--r--version.h6
4 files changed, 22 insertions, 19 deletions
diff --git a/ChangeLog b/ChangeLog
index fcbbade..f1a9659 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,10 @@
+Fri Jul 6 02:08:25 2007 Koichi Sasada <ko1@atdot.net>
+
+ * insns.def: fix to invoke nil.to_splat on NODE_ARGSCAT.
+ [ruby-dev:31138].
+
+ * bootstraptest/test_literal.rb: add tests for above.
+
Thu Jul 5 19:45:55 2007 Koichi Sasada <ko1@atdot.net>
* yarvcore.h: rename rb_control_frame_t#magic to flag.
diff --git a/bootstraptest/test_literal.rb b/bootstraptest/test_literal.rb
index 2ef47a5..7696396 100644
--- a/bootstraptest/test_literal.rb
+++ b/bootstraptest/test_literal.rb
@@ -113,6 +113,8 @@ assert_equal '1', 'a = [obj = Object.new]; a.size'
assert_equal 'true', 'a = [obj = Object.new]; a[0] == obj'
assert_equal '5', 'a = [1,2,3]; a[1] = 5; a[1]'
assert_equal 'bar', '[*:foo];:bar'
+assert_equal '[1, 2]', 'def nil.to_splat; [2]; end; [1, *nil]'
+assert_equal '[1, 2]', 'def nil.to_splat; [1, 2]; end; [*nil]'
# hash
assert_equal 'Hash', '{}.class'
diff --git a/insns.def b/insns.def
index 63f1ca1..51e5272 100644
--- a/insns.def
+++ b/insns.def
@@ -555,27 +555,21 @@ concatarray
(VALUE ary)
{
VALUE ary2 = ary2st;
+ VALUE tmp1 = rb_check_convert_type(ary1, T_ARRAY, "Array", "to_splat");
+ VALUE tmp2 = rb_check_convert_type(ary2, T_ARRAY, "Array", "to_splat");
- if (ary2 == Qnil) {
- ary = ary1;
+ if (NIL_P(tmp1)) {
+ tmp1 = rb_ary_new3(1, ary1);
}
- else {
- VALUE tmp1 = rb_check_convert_type(ary1, T_ARRAY, "Array", "to_splat");
- VALUE tmp2 = rb_check_convert_type(ary2, T_ARRAY, "Array", "to_splat");
- if (NIL_P(tmp1)) {
- tmp1 = rb_ary_new3(1, ary1);
- }
-
- if (NIL_P(tmp2)) {
- tmp2 = rb_ary_new3(1, ary2);
- }
+ if (NIL_P(tmp2)) {
+ tmp2 = rb_ary_new3(1, ary2);
+ }
- if (tmp1 == ary1) {
- tmp1 = rb_ary_dup(ary1);
- }
- ary = rb_ary_concat(tmp1, tmp2);
+ if (tmp1 == ary1) {
+ tmp1 = rb_ary_dup(ary1);
}
+ ary = rb_ary_concat(tmp1, tmp2);
}
/**
diff --git a/version.h b/version.h
index 7cac334..f1538f4 100644
--- a/version.h
+++ b/version.h
@@ -1,7 +1,7 @@
#define RUBY_VERSION "1.9.0"
-#define RUBY_RELEASE_DATE "2007-07-05"
+#define RUBY_RELEASE_DATE "2007-07-06"
#define RUBY_VERSION_CODE 190
-#define RUBY_RELEASE_CODE 20070705
+#define RUBY_RELEASE_CODE 20070706
#define RUBY_PATCHLEVEL 0
#define RUBY_VERSION_MAJOR 1
@@ -9,7 +9,7 @@
#define RUBY_VERSION_TEENY 0
#define RUBY_RELEASE_YEAR 2007
#define RUBY_RELEASE_MONTH 7
-#define RUBY_RELEASE_DAY 5
+#define RUBY_RELEASE_DAY 6
#ifdef RUBY_EXTERN
RUBY_EXTERN const char ruby_version[];