aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--ChangeLog5
-rw-r--r--parse.y2
-rw-r--r--test/ruby/test_system.rb4
3 files changed, 10 insertions, 1 deletions
diff --git a/ChangeLog b/ChangeLog
index 6b93dcee76..11202f5dd5 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+Wed Dec 8 11:46:26 2004 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * parse.y (string_content): get rid of segfault at empty evstr.
+ fixed: [ruby-dev:25113]
+
Wed Dec 8 03:26:51 2004 GOTOU Yuuzou <gotoyuzo@notwork.org>
* ext/openssl/ossl_bio.c (ossl_obj2bio): should not use fptr->f.
diff --git a/parse.y b/parse.y
index 5bc3476014..2006610b90 100644
--- a/parse.y
+++ b/parse.y
@@ -3599,7 +3599,7 @@ string_content : tSTRING_CONTENT
COND_LEXPOP();
CMDARG_LEXPOP();
/*%%%*/
- $3->flags &= ~NODE_NEWLINE;
+ if ($3) $3->flags &= ~NODE_NEWLINE;
$$ = new_evstr($3);
/*%
$$ = dispatch1(string_embexpr, $3);
diff --git a/test/ruby/test_system.rb b/test/ruby/test_system.rb
index 410dd83e2a..826c615cd3 100644
--- a/test/ruby/test_system.rb
+++ b/test/ruby/test_system.rb
@@ -60,4 +60,8 @@ class TestSystem < Test::Unit::TestCase
end
end
end
+
+ def test_empty_evstr # [ruby-dev:25113]
+ assert_equal("", eval('"#{}"', nil, __FILE__, __LINE__))
+ end
end