summaryrefslogtreecommitdiff
path: root/gc.c
diff options
context:
space:
mode:
authorknu <knu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2007-03-03 07:28:54 +0000
committerknu <knu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2007-03-03 07:28:54 +0000
commitdeeafa0e178fad98e05a538e8392fbcd7aab072e (patch)
tree28b6215d5f7ab78bdd6f61a4099514dbd27e20d0 /gc.c
parent618510d30c27fd490cb7a0faa55837d1a46d08b4 (diff)
* env.h (SCOPE_CLONE): Introduce a new scope flag to prevent a
local_tbl region from getting freed many times; submitted by Chikanaga Tomoyuki <chikanag AT nippon-control-system.co.jp> in [ruby-dev:30460]. * eval.c (proc_invoke): Ditto. * gc.c (obj_free): Ditto. * parse.y (top_local_setup_gen): Ditto. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_8@11964 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'gc.c')
-rw-r--r--gc.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/gc.c b/gc.c
index e3b088efd1..9ac3bfbf6f 100644
--- a/gc.c
+++ b/gc.c
@@ -1253,7 +1253,7 @@ obj_free(obj)
if (RANY(obj)->as.scope.local_vars &&
RANY(obj)->as.scope.flags != SCOPE_ALLOCA) {
VALUE *vars = RANY(obj)->as.scope.local_vars-1;
- if (vars[0] == 0)
+ if (!(RANY(obj)->as.scope.flags & SCOPE_CLONE) && vars[0] == 0)
RUBY_CRITICAL(free(RANY(obj)->as.scope.local_tbl));
if (RANY(obj)->as.scope.flags & SCOPE_MALLOC)
RUBY_CRITICAL(free(vars));