1
0
Fork 0
mirror of https://github.com/ruby/ruby.git synced 2022-11-09 12:17:21 -05:00

* dir.c (push_glob): add RB_GC_GUARD to prevent str being free'ed.

a patch from Masaya TARUI in [ruby-dev:40939].  [ruby-dev:40514]

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@27268 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
mame 2010-04-09 11:08:06 +00:00
parent e9cfe47700
commit 5dd8daaa27
2 changed files with 10 additions and 2 deletions

View file

@ -1,3 +1,8 @@
Fri Apr 9 20:05:05 2010 Yusuke Endoh <mame@tsg.ne.jp>
* dir.c (push_glob): add RB_GC_GUARD to prevent str being free'ed.
a patch from Masaya TARUI in [ruby-dev:40939]. [ruby-dev:40514]
Fri Apr 9 10:53:00 2010 Kenta Murata <mrkn@mrkn.jp>
* compile.c (iseq_compile_each): stop hiding, and freeze unpopped

7
dir.c
View file

@ -1622,14 +1622,17 @@ push_glob(VALUE ary, VALUE str, int flags)
{
struct glob_args args;
rb_encoding *enc = rb_enc_get(str);
int ret;
if (enc == rb_usascii_encoding()) enc = rb_filesystem_encoding();
args.func = push_pattern;
args.value = ary;
args.enc = enc;
return ruby_brace_glob0(RSTRING_PTR(str), flags | GLOB_VERBOSE,
rb_glob_caller, (VALUE)&args, enc);
ret = ruby_brace_glob0(RSTRING_PTR(str), flags | GLOB_VERBOSE,
rb_glob_caller, (VALUE)&args, enc);
RB_GC_GUARD(str);
return ret;
}
static VALUE