-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* include/ruby/ruby.h (struct RRegexp): new field usecnt. replace
str and len by src. * gc.c (gc_mark_children): mark src field of regexp. (obj_free): don't free str field. * re.c (REG_BUSY): removed. (rb_reg_initialize): prohibit re-initialize regexp. (rb_reg_search): use usecnt to prevent freeing regexp currently using. this prevents SEGV by: r = /\A((a.)*(a.)*)*b/ r =~ "ab" + "\xc2\xa1".force_encoding("euc-jp") t = Thread.new { r =~ "ab"*8 + "\xc2\xa1".force_encoding("utf-8")} sleep 0.2 r =~ "ab"*8 + "\xc2\xa1".force_encoding("euc-jp") git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@17635 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
- Loading branch information
Showing
6 changed files
with
69 additions
and
49 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,21 @@ | ||
Sat Jun 28 21:25:08 2008 Tanaka Akira <[email protected]> | ||
|
||
* include/ruby/ruby.h (struct RRegexp): new field usecnt. replace | ||
str and len by src. | ||
|
||
* gc.c (gc_mark_children): mark src field of regexp. | ||
(obj_free): don't free str field. | ||
|
||
* re.c (REG_BUSY): removed. | ||
(rb_reg_initialize): prohibit re-initialize regexp. | ||
(rb_reg_search): use usecnt to prevent freeing regexp currently | ||
using. this prevents SEGV by: | ||
r = /\A((a.)*(a.)*)*b/ | ||
r =~ "ab" + "\xc2\xa1".force_encoding("euc-jp") | ||
t = Thread.new { r =~ "ab"*8 + "\xc2\xa1".force_encoding("utf-8")} | ||
sleep 0.2 | ||
r =~ "ab"*8 + "\xc2\xa1".force_encoding("euc-jp") | ||
|
||
Sat Jun 28 21:15:43 2008 Nobuyoshi Nakada <[email protected]> | ||
|
||
* include/ruby/intern.h (rb_str_new2, rb_tainted_str_new2, | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters