summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authormame <mame@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2010-07-22 13:37:07 +0000
committermame <mame@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2010-07-22 13:37:07 +0000
commit7909d9d0c7bbc38f3893df1b6f66863bb1082ac8 (patch)
tree3aae197fc9287613658ad439eeed63b842cb011b
parent94339a8fd787c1788e72d5f032572860ba5deb05 (diff)
merge revision(s) 28648:
* regexec.c (onig_search): don't skip non-ANYCHARs when .* fails to match. This causes to fail matching ANYCHAR_STAR with LOOK_BEHIND. This fix is workaround and disable the optimization. [ruby-dev:41851] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_9_2@28721 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
-rw-r--r--ChangeLog7
-rw-r--r--regexec.c5
-rw-r--r--test/ruby/test_regexp.rb5
3 files changed, 12 insertions, 5 deletions
diff --git a/ChangeLog b/ChangeLog
index 3ace8afbea..b7779d9e53 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,10 @@
+Thu Jul 22 22:14:59 2010 NARUSE, Yui <naruse@ruby-lang.org>
+
+ * regexec.c (onig_search): don't skip non-ANYCHARs when
+ .* fails to match. This causes to fail matching
+ ANYCHAR_STAR with LOOK_BEHIND. This fix is workaround
+ and disable the optimization. [ruby-dev:41851]
+
Thu Jul 22 22:13:48 2010 Yusuke Endoh <mame@tsg.ne.jp>
* thread_pthread.c (get_stack): fix memory leak; pthread_attr_destory
diff --git a/regexec.c b/regexec.c
index c011480ec8..13b6fadee2 100644
--- a/regexec.c
+++ b/regexec.c
@@ -3636,11 +3636,6 @@ onig_search(regex_t* reg, const UChar* str, const UChar* end,
MATCH_AND_RETURN_CHECK(orig_range);
prev = s;
s += enclen(reg->enc, s, end);
-
- while (!ONIGENC_IS_MBC_NEWLINE(reg->enc, prev, end) && s < range) {
- prev = s;
- s += enclen(reg->enc, s, end);
- }
} while (s < range);
goto mismatch;
}
diff --git a/test/ruby/test_regexp.rb b/test/ruby/test_regexp.rb
index 9fd948d6a1..9e850b902e 100644
--- a/test/ruby/test_regexp.rb
+++ b/test/ruby/test_regexp.rb
@@ -11,6 +11,11 @@ class TestRegexp < Test::Unit::TestCase
$VERBOSE = @verbose
end
+ def test_ruby_dev_999
+ assert_match(/(?<=a).*b/, "aab")
+ assert_match(/(?<=\u3042).*b/, "\u3042ab")
+ end
+
def test_ruby_core_27247
assert_match(/(a){2}z/, "aaz")
end