summaryrefslogtreecommitdiff
path: root/array.c
diff options
context:
space:
mode:
authorknu <knu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2008-05-22 03:31:43 +0000
committerknu <knu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2008-05-22 03:31:43 +0000
commitab3d450a54ad9407548a36f01cb3775a6533c3d7 (patch)
tree718be2ccfd09553d5767b4df0684f8f359a2662c /array.c
parentb524523217b51e864c010646ffd5cbc4154d2fd3 (diff)
Merge from ruby_1_8.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_8_7@16521 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'array.c')
-rw-r--r--array.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/array.c b/array.c
index 1121b0f..e3d92ba 100644
--- a/array.c
+++ b/array.c
@@ -3124,6 +3124,7 @@ flatten(ary, level, modified)
*modified = 1;
id = (st_data_t)tmp;
if (st_lookup(memo, id, 0)) {
+ st_free_table(memo);
rb_raise(rb_eArgError, "tried to flatten recursive array");
}
st_insert(memo, id, (st_data_t)Qtrue);
@@ -3143,6 +3144,8 @@ flatten(ary, level, modified)
ary = rb_ary_pop(stack);
}
+ st_free_table(memo);
+
return result;
}