Skip to content

Commit

Permalink
* dir.c (dir_s_glob): restore GC protection volatile variable.
Browse files Browse the repository at this point in the history
  [ruby-dev:29588]

* re.c (rb_reg_regcomp): ditto.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@10960 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
  • Loading branch information
matz committed Sep 18, 2006
1 parent 3851ac0 commit 6bf30a9
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 2 deletions.
7 changes: 7 additions & 0 deletions ChangeLog
Original file line number Diff line number Diff line change
@@ -1,3 +1,10 @@
Mon Sep 18 15:29:21 2006 Yukihiro Matsumoto <[email protected]>

* 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 <[email protected]>

* numeric.c (fix_mul): get rid of shift overflow.
Expand Down
3 changes: 2 additions & 1 deletion dir.c
Original file line number Diff line number Diff line change
Expand Up @@ -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()) {
Expand Down
3 changes: 2 additions & 1 deletion re.c
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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);
}

Expand Down

0 comments on commit 6bf30a9

Please sign in to comment.