mirror of
https://github.com/ruby/ruby.git
synced 2022-11-09 12:17:21 -05:00
* eval.c (blk_copy_prev): need frame_dup(). [ruby-dev:24103]
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_8@6901 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
parent
d5188667bc
commit
dc5ea1179a
2 changed files with 32 additions and 27 deletions
|
@ -1,3 +1,7 @@
|
|||
Mon Sep 13 19:16:33 2004 WATANABE Hirofumi <eban@ruby-lang.org>
|
||||
|
||||
* eval.c (blk_copy_prev): need frame_dup(). [ruby-dev:24103]
|
||||
|
||||
Mon Sep 13 16:23:27 2004 Hidetoshi NAGAI <nagai@ai.kyutech.ac.jp>
|
||||
|
||||
* ext/tk/lib/multi-tk.rb: MultiTkIp.new_master and new_slave accept
|
||||
|
|
55
eval.c
55
eval.c
|
@ -7755,33 +7755,6 @@ blk_free(data)
|
|||
}
|
||||
}
|
||||
|
||||
static void
|
||||
blk_copy_prev(block)
|
||||
struct BLOCK *block;
|
||||
{
|
||||
struct BLOCK *tmp;
|
||||
struct RVarmap* vars;
|
||||
|
||||
while (block->prev) {
|
||||
tmp = ALLOC_N(struct BLOCK, 1);
|
||||
MEMCPY(tmp, block->prev, struct BLOCK, 1);
|
||||
if (tmp->frame.argc > 0) {
|
||||
tmp->frame.argv = ALLOC_N(VALUE, tmp->frame.argc);
|
||||
MEMCPY(tmp->frame.argv, block->prev->frame.argv, VALUE, tmp->frame.argc);
|
||||
tmp->frame.flags |= FRAME_MALLOC;
|
||||
}
|
||||
scope_dup(tmp->scope);
|
||||
|
||||
for (vars = tmp->dyna_vars; vars; vars = vars->next) {
|
||||
if (FL_TEST(vars, DVAR_DONT_RECYCLE)) break;
|
||||
FL_SET(vars, DVAR_DONT_RECYCLE);
|
||||
}
|
||||
|
||||
block->prev = tmp;
|
||||
block = tmp;
|
||||
}
|
||||
}
|
||||
|
||||
static void
|
||||
frame_dup(frame)
|
||||
struct FRAME *frame;
|
||||
|
@ -7806,6 +7779,34 @@ frame_dup(frame)
|
|||
}
|
||||
|
||||
|
||||
static void
|
||||
blk_copy_prev(block)
|
||||
struct BLOCK *block;
|
||||
{
|
||||
struct BLOCK *tmp;
|
||||
struct RVarmap* vars;
|
||||
|
||||
while (block->prev) {
|
||||
tmp = ALLOC_N(struct BLOCK, 1);
|
||||
MEMCPY(tmp, block->prev, struct BLOCK, 1);
|
||||
if (tmp->frame.argc > 0) {
|
||||
tmp->frame.argv = ALLOC_N(VALUE, tmp->frame.argc);
|
||||
MEMCPY(tmp->frame.argv, block->prev->frame.argv, VALUE, tmp->frame.argc);
|
||||
tmp->frame.flags |= FRAME_MALLOC;
|
||||
}
|
||||
scope_dup(tmp->scope);
|
||||
frame_dup(&tmp->frame);
|
||||
|
||||
for (vars = tmp->dyna_vars; vars; vars = vars->next) {
|
||||
if (FL_TEST(vars, DVAR_DONT_RECYCLE)) break;
|
||||
FL_SET(vars, DVAR_DONT_RECYCLE);
|
||||
}
|
||||
|
||||
block->prev = tmp;
|
||||
block = tmp;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* MISSING: documentation
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue