[jruby-joni] 117/194: use range and guard against length

Hideki Yamane henrich at moszumanska.debian.org
Thu Feb 1 12:04:33 UTC 2018


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 d8d1c5146b071e419fc9bf2997f1efa202f4f0a4
Author: Marcin Mielzynski <lopx at gazeta.pl>
Date:   Mon Jan 8 01:08:01 2018 +0100

    use range and guard against length
---
 src/org/joni/ByteCodeMachine.java | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/src/org/joni/ByteCodeMachine.java b/src/org/joni/ByteCodeMachine.java
index ed4f63a..0fa26b4 100644
--- a/src/org/joni/ByteCodeMachine.java
+++ b/src/org/joni/ByteCodeMachine.java
@@ -1889,7 +1889,7 @@ class ByteCodeMachine extends StackMachine {
     }
 
     private void opPushAbsentPos() {
-        pushAbsentPos(s, end);
+        pushAbsentPos(s, range);
     }
 
     private void opAbsent() {
@@ -1913,8 +1913,9 @@ class ByteCodeMachine extends StackMachine {
             }
             ip += addr;
         } else {
+
             pushAlt(ip + addr, s, sprev, pkeep);
-            int n = enc.length(bytes, s, end);
+            int n = (s >= end) ? 1 : enc.length(bytes, s, end);
             pushAbsentPos(absent, range);
             pushAlt(selfip, s + n, s, pkeep);
             pushAbsent();

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