[jruby-joni] 215/223: fix for word bounds

Hideki Yamane henrich at moszumanska.debian.org
Mon Nov 16 11:22:16 UTC 2015


This is an automated email from the git hooks/post-receive script.

henrich pushed a commit to branch debian/sid
in repository jruby-joni.

commit 5a13be3ecff79128e2e2f0dec2c9a6bbf2a7c8f9
Author: Marcin Mielzynski <lopx at gazeta.pl>
Date:   Thu Oct 15 19:58:53 2015 +0200

    fix for word bounds
---
 src/org/joni/ByteCodeMachine.java | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/src/org/joni/ByteCodeMachine.java b/src/org/joni/ByteCodeMachine.java
index a6a0cdd..1514d08 100644
--- a/src/org/joni/ByteCodeMachine.java
+++ b/src/org/joni/ByteCodeMachine.java
@@ -1060,7 +1060,7 @@ class ByteCodeMachine extends StackMachine {
         if (s == str) {
             if (s >= range || !enc.isMbcWord(bytes, s, end)) {opFail(); return;}
         } else if (s == end) {
-            if (!enc.isMbcWord(bytes, sprev, end)) {opFail(); return;}
+            if (s >= range || !enc.isMbcWord(bytes, sprev, end)) {opFail(); return;}
         } else {
             if (enc.isMbcWord(bytes, s, end) == enc.isMbcWord(bytes, sprev, end)) {opFail(); return;}
         }
@@ -1080,7 +1080,7 @@ class ByteCodeMachine extends StackMachine {
         if (s == str) {
             if (s < range && enc.isMbcWord(bytes, s, end)) {opFail(); return;}
         } else if (s == end) {
-            if (enc.isMbcWord(bytes, sprev, end)) {opFail(); return;}
+            if (sprev < end && enc.isMbcWord(bytes, sprev, end)) {opFail(); return;}
         } else {
             if (enc.isMbcWord(bytes, s, end) != enc.isMbcWord(bytes, sprev, end)) {opFail(); return;}
         }

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-java/jruby-joni.git



More information about the pkg-java-commits mailing list