mirror of
https://github.com/ruby/ruby.git
synced 2022-11-09 12:17:21 -05:00
merge revision(s) 44449: [Backport #9416]
* parse.y (local_push_gen, local_pop_gen): save cmdarg_stack to isolate command argument state from outer scope. [ruby-core:59342] [Bug #9308] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_2_1@45086 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
parent
adfa331bbc
commit
02cc3d942a
4 changed files with 16 additions and 1 deletions
|
@ -1,3 +1,9 @@
|
|||
Sat Feb 22 00:21:50 2014 Nobuyoshi Nakada <nobu@ruby-lang.org>
|
||||
|
||||
* parse.y (local_push_gen, local_pop_gen): save cmdarg_stack to
|
||||
isolate command argument state from outer scope.
|
||||
[ruby-core:59342] [Bug #9308]
|
||||
|
||||
Fri Feb 21 23:51:38 2014 Nobuyoshi Nakada <nobu@ruby-lang.org>
|
||||
|
||||
* encoding.c (must_encindex, rb_enc_from_index, rb_obj_encoding): mask
|
||||
|
|
4
parse.y
4
parse.y
|
@ -130,6 +130,7 @@ struct local_vars {
|
|||
struct vtable *vars;
|
||||
struct vtable *used;
|
||||
struct local_vars *prev;
|
||||
stack_type cmdargs;
|
||||
};
|
||||
|
||||
#define DVARS_INHERIT ((void*)1)
|
||||
|
@ -9642,6 +9643,8 @@ local_push_gen(struct parser_params *parser, int inherit_dvars)
|
|||
local->used = !(inherit_dvars &&
|
||||
(ifndef_ripper(compile_for_eval || e_option_supplied(parser))+0)) &&
|
||||
RTEST(ruby_verbose) ? vtable_alloc(0) : 0;
|
||||
local->cmdargs = cmdarg_stack;
|
||||
cmdarg_stack = 0;
|
||||
lvtbl = local;
|
||||
}
|
||||
|
||||
|
@ -9655,6 +9658,7 @@ local_pop_gen(struct parser_params *parser)
|
|||
}
|
||||
vtable_free(lvtbl->args);
|
||||
vtable_free(lvtbl->vars);
|
||||
cmdarg_stack = lvtbl->cmdargs;
|
||||
xfree(lvtbl);
|
||||
lvtbl = local;
|
||||
}
|
||||
|
|
|
@ -256,6 +256,11 @@ WARN
|
|||
assert_valid_syntax("p begin 1.times do 1 end end", __FILE__, bug6419)
|
||||
end
|
||||
|
||||
def test_do_block_in_call_args
|
||||
bug9308 = '[ruby-core:59342] [Bug #9308]'
|
||||
assert_valid_syntax("bar def foo; self.each do end end", bug9308)
|
||||
end
|
||||
|
||||
def test_reserved_method_no_args
|
||||
bug6403 = '[ruby-dev:45626]'
|
||||
assert_valid_syntax("def self; :foo; end", __FILE__, bug6403)
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
#define RUBY_VERSION "2.1.1"
|
||||
#define RUBY_RELEASE_DATE "2014-02-22"
|
||||
#define RUBY_PATCHLEVEL 48
|
||||
#define RUBY_PATCHLEVEL 49
|
||||
|
||||
#define RUBY_RELEASE_YEAR 2014
|
||||
#define RUBY_RELEASE_MONTH 2
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue