From 6a26b59600c7c66611c9a52038bb95ff4d4194c0 Mon Sep 17 00:00:00 2001 From: nobu Date: Sun, 2 Aug 2009 12:04:43 +0000 Subject: [PATCH] * parse.y (literal_concat0): tail can be nil. [ruby-dev:38980] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@24356 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- ChangeLog | 4 ++++ bootstraptest/test_syntax.rb | 5 +++++ parse.y | 1 + 3 files changed, 10 insertions(+) diff --git a/ChangeLog b/ChangeLog index 239b487f1e..a2d7281955 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,7 @@ +Sun Aug 2 21:04:37 2009 Nobuyoshi Nakada + + * parse.y (literal_concat0): tail can be nil. [ruby-dev:38980] + Sun Aug 2 20:09:07 2009 Nobuyoshi Nakada * array.c (rb_ary_combination, rb_ary_product): prevent from GC. diff --git a/bootstraptest/test_syntax.rb b/bootstraptest/test_syntax.rb index 131625ea6b..6843b23285 100644 --- a/bootstraptest/test_syntax.rb +++ b/bootstraptest/test_syntax.rb @@ -831,3 +831,8 @@ assert_normal_exit %q{ assert_equal 'ok', %q{ "#{}""#{}ok" }, '[ruby-dev:38968]' + + +assert_equal 'ok', %q{ + "o" "#{}k" +}, '[ruby-dev:38980]' diff --git a/parse.y b/parse.y index 80fef61f34..646e0ceeff 100644 --- a/parse.y +++ b/parse.y @@ -7782,6 +7782,7 @@ list_concat_gen(struct parser_params *parser, NODE *head, NODE *tail) static int literal_concat0(struct parser_params *parser, VALUE head, VALUE tail) { + if (NIL_P(tail)) return 1; if (!rb_enc_compatible(head, tail)) { compile_error(PARSER_ARG "string literal encodings differ (%s / %s)", rb_enc_name(rb_enc_get(head)),