From 303c28d49b7a0990d597b753f9976a10d1e26a2f Mon Sep 17 00:00:00 2001 From: nobu Date: Fri, 12 Dec 2008 07:23:24 +0000 Subject: [PATCH] * parse.y (yycompile0): ruby_eval_tree_begin is always 0 when ruby_eval_tree is 0. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@20657 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- ChangeLog | 5 +++++ parse.y | 12 ++---------- 2 files changed, 7 insertions(+), 10 deletions(-) diff --git a/ChangeLog b/ChangeLog index 1fee2b14e0..cd2f2ae731 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +Fri Dec 12 16:23:18 2008 Nobuyoshi Nakada + + * parse.y (yycompile0): ruby_eval_tree_begin is always 0 when + ruby_eval_tree is 0. + Fri Dec 12 14:09:55 2008 Yuki Sonoda (Yugui) * encoding.c (enc_get_default_encoding): removed. diff --git a/parse.y b/parse.y index 72d1b1d31d..b462322339 100644 --- a/parse.y +++ b/parse.y @@ -5015,16 +5015,8 @@ yycompile0(VALUE arg, int tracing) if (!tree) { tree = NEW_NIL(); } - if (ruby_eval_tree_begin) { - NODE *scope = ruby_eval_tree; - - if (scope) { - scope->nd_body = NEW_PRELUDE(ruby_eval_tree_begin, scope->nd_body); - } - tree = scope; - } - else { - tree = ruby_eval_tree; + else if (ruby_eval_tree_begin) { + tree->nd_body = NEW_PRELUDE(ruby_eval_tree_begin, tree->nd_body); } return (VALUE)tree; }