diff options
-rw-r--r-- | ChangeLog | 5 | ||||
-rw-r--r-- | compile.c | 7 | ||||
-rw-r--r-- | test/ruby/test_syntax.rb | 5 | ||||
-rw-r--r-- | version.h | 6 |
4 files changed, 19 insertions, 4 deletions
@@ -1,3 +1,8 @@ +Tue Apr 16 00:27:56 2013 Nobuyoshi Nakada <nobu@ruby-lang.org> + + * 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@ruby-lang.org> * ext/curses/curses.c (Init_curses): fix implementation function, @@ -5161,7 +5161,12 @@ iseq_compile_each(rb_iseq_t *iseq, LINK_ANCHOR *ret, NODE * node, int poped) 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; diff --git a/test/ruby/test_syntax.rb b/test/ruby/test_syntax.rb index bc29007359..cbaae5a249 100644 --- a/test/ruby/test_syntax.rb +++ b/test/ruby/test_syntax.rb @@ -10,6 +10,11 @@ class TestSyntax < Test::Unit::TestCase 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_") @@ -1,10 +1,10 @@ #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" |