diff options
-rw-r--r-- | ChangeLog | 7 | ||||
-rw-r--r-- | dir.c | 3 | ||||
-rw-r--r-- | re.c | 3 |
3 files changed, 11 insertions, 2 deletions
@@ -1,3 +1,10 @@ +Mon Sep 18 15:29:21 2006 Yukihiro Matsumoto <matz@ruby-lang.org> + + * dir.c (dir_s_glob): restore GC protection volatile variable. + [ruby-dev:29588] + + * re.c (rb_reg_regcomp): ditto. + Mon Sep 18 12:16:48 2006 Nobuyoshi Nakada <nobu@ruby-lang.org> * numeric.c (fix_mul): get rid of shift overflow. @@ -1629,7 +1629,8 @@ dir_s_glob(int argc, VALUE *argv, VALUE obj) ary = rb_push_glob(str, flags); } else { - ary = dir_globs(RARRAY_LEN(ary), RARRAY_PTR(ary), flags); + volatile VALUE v = ary; + ary = dir_globs(RARRAY_LEN(v), RARRAY_PTR(v), flags); } if (rb_block_given_p()) { @@ -1508,6 +1508,7 @@ static VALUE reg_cache; VALUE rb_reg_regcomp(VALUE str) { + volatile VALUE save_str = str; if (reg_cache && RREGEXP(reg_cache)->len == RSTRING_LEN(str) && case_cache == ruby_ignorecase && kcode_cache == reg_kcode @@ -1516,7 +1517,7 @@ rb_reg_regcomp(VALUE str) case_cache = ruby_ignorecase; kcode_cache = reg_kcode; - return reg_cache = rb_reg_new(RSTRING_PTR(str), RSTRING_LEN(str), + return reg_cache = rb_reg_new(RSTRING_PTR(save_str), RSTRING_LEN(save_str), ruby_ignorecase); } |