[jruby-joni] 147/279: Fix for JRUBY-6682 (jgem search -r ak ' causes exceptions.)

Hideki Yamane henrich at moszumanska.debian.org
Mon Nov 16 11:27:18 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 e7d1f0bff0273c8e2448f3e3f16891b1bcb41209
Author: Marcin Mielzynski <lopx at gazeta.pl>
Date:   Tue Jul 3 21:39:56 2012 +0200

    Fix for JRUBY-6682 (jgem search -r ak ' causes exceptions.)
---
 src/org/joni/ByteCodeMachine.java | 4 ++--
 test/org/joni/test/TestU8.java    | 1 +
 2 files changed, 3 insertions(+), 2 deletions(-)

diff --git a/src/org/joni/ByteCodeMachine.java b/src/org/joni/ByteCodeMachine.java
index db4d6a2..9056166 100644
--- a/src/org/joni/ByteCodeMachine.java
+++ b/src/org/joni/ByteCodeMachine.java
@@ -526,7 +526,7 @@ class ByteCodeMachine extends StackMachine {
 
     private void opExactMB2N() {
         int tlen = code[ip++];
-        if (tlen * 2 > range) {opFail(); return;}
+        if (s + tlen * 2 > range) {opFail(); return;}
 
         if (Config.USE_STRING_TEMPLATES) {
             byte[]bs = regex.templates[code[ip++]];
@@ -551,7 +551,7 @@ class ByteCodeMachine extends StackMachine {
 
     private void opExactMB3N() {
         int tlen = code[ip++];
-        if (tlen * 3 > range) {opFail(); return;}
+        if (s + tlen * 3 > range) {opFail(); return;}
 
         if (Config.USE_STRING_TEMPLATES) {
             byte[]bs = regex.templates[code[ip++]];
diff --git a/test/org/joni/test/TestU8.java b/test/org/joni/test/TestU8.java
index a3f0767..53400f6 100644
--- a/test/org/joni/test/TestU8.java
+++ b/test/org/joni/test/TestU8.java
@@ -75,6 +75,7 @@ public class TestU8 extends Test {
         // x2s(pat2, str2, 4, 4);
         // x2s(pat2, str2, 4, 4, Option.IGNORECASE);
 
+        ns("(?i-mx:ak)a", "ema");
     }
 
     public static void main(String[] args) throws Throwable {

-- 
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