diff --git a/ChangeLog b/ChangeLog index 2d5aa69a6d..b59dd16bf5 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +Fri Apr 9 20:29:13 2010 Yusuke Endoh + + * dir.c (push_glob): clear up the previous commit (RB_GC_GUARD can + precede the last reference). [ruby-dev:40942] + Fri Apr 9 20:05:05 2010 Yusuke Endoh * dir.c (push_glob): add RB_GC_GUARD to prevent str being free'ed. diff --git a/dir.c b/dir.c index 6cdccd8b85..9c1c792cbe 100644 --- a/dir.c +++ b/dir.c @@ -1622,17 +1622,15 @@ 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; - ret = ruby_brace_glob0(RSTRING_PTR(str), flags | GLOB_VERBOSE, - rb_glob_caller, (VALUE)&args, enc); RB_GC_GUARD(str); - return ret; + return ruby_brace_glob0(RSTRING_PTR(str), flags | GLOB_VERBOSE, + rb_glob_caller, (VALUE)&args, enc); } static VALUE