re.c: applied stack error handling patch. [ruby-dev:22431]
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@6213 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
parent
eb93c74314
commit
fa659c1449
@ -1,3 +1,7 @@
|
|||||||
|
Sat Apr 24 14:32:03 2004 Kazuo Saito <ksaito@uranus.dti.ne.jp>
|
||||||
|
|
||||||
|
* re.c: applied stack error handling patch. [ruby-dev:22431]
|
||||||
|
|
||||||
Sat Apr 24 10:38:31 2004 Dave Thomas <dave@pragprog.com>
|
Sat Apr 24 10:38:31 2004 Dave Thomas <dave@pragprog.com>
|
||||||
|
|
||||||
* lib/rdoc/markup/simple_markup.rb (SM::SimpleMarkup::group_lines):
|
* lib/rdoc/markup/simple_markup.rb (SM::SimpleMarkup::group_lines):
|
||||||
|
12
re.c
12
re.c
@ -920,15 +920,17 @@ rb_reg_search(re, str, pos, reverse)
|
|||||||
if (FL_TEST(re, KCODE_FIXED))
|
if (FL_TEST(re, KCODE_FIXED))
|
||||||
kcode_reset_option();
|
kcode_reset_option();
|
||||||
|
|
||||||
if (result == -2) {
|
|
||||||
rb_reg_raise(RREGEXP(re)->str, RREGEXP(re)->len,
|
|
||||||
"Stack overflow in regexp matcher", re);
|
|
||||||
}
|
|
||||||
|
|
||||||
if (result < 0) {
|
if (result < 0) {
|
||||||
|
if (result == ONIG_MISMATCH) {
|
||||||
rb_backref_set(Qnil);
|
rb_backref_set(Qnil);
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
else {
|
||||||
|
char err[ONIG_MAX_ERROR_MESSAGE_LEN];
|
||||||
|
re_error_code_to_str((UChar* )err, result);
|
||||||
|
rb_reg_raise(RREGEXP(re)->str, RREGEXP(re)->len, err, 0);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
match = rb_backref_get();
|
match = rb_backref_get();
|
||||||
if (NIL_P(match) || FL_TEST(match, MATCH_BUSY)) {
|
if (NIL_P(match) || FL_TEST(match, MATCH_BUSY)) {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user