[jruby-joni] 51/279: Fix for JRUBY-2603: Couple of new rubyspec failures for URI library. (Bad optimization info was emitted from ast for PREC_READ anchors.

Hideki Yamane henrich at moszumanska.debian.org
Mon Nov 16 11:26:42 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 6c74de667336076edcaf83baba9c3e0b11d0486b
Author: Marcin Mielżyński <lopx at gazeta.pl>
Date:   Thu Feb 5 18:50:59 2009 +0000

    Fix for JRUBY-2603: Couple of new rubyspec failures for URI library. (Bad optimization info was emitted from ast for PREC_READ anchors.
    
    git-svn-id: http://svn.codehaus.org/jruby/joni/trunk@9022 961051c9-f516-0410-bf72-c9f7e237a7b7
---
 src/org/joni/Analyser.java    | 11 +++++------
 src/org/joni/NodeOptInfo.java | 11 ++++++-----
 2 files changed, 11 insertions(+), 11 deletions(-)

diff --git a/src/org/joni/Analyser.java b/src/org/joni/Analyser.java
index 3bbf860..cce91ba 100644
--- a/src/org/joni/Analyser.java
+++ b/src/org/joni/Analyser.java
@@ -1915,7 +1915,7 @@ final class Analyser extends Parser {
             
             if (!sn.isAmbig()) {
                 opt.exb.concatStr(sn.bytes, sn.p, sn.end, sn.isRaw(), enc);
-            
+
                 if (slen > 0) {
                     opt.map.addChar(sn.bytes[sn.p], enc);
                 }
@@ -2019,12 +2019,11 @@ final class Analyser extends Parser {
                     opt.expr.copy(nopt.exb);
                 } else if (nopt.exm.length > 0) {
                     opt.expr.copy(nopt.exm);
-                    opt.expr.reachEnd = true;
-                    
-                    if (nopt.map.value > 0) opt.map.copy(nopt.map);
                 }
+                opt.expr.reachEnd = false;
+                if (nopt.map.value > 0) opt.map.copy(nopt.map);
                 break;
-                
+
             case AnchorType.PREC_READ_NOT:
             case AnchorType.LOOK_BEHIND:    /* Sorry, I can't make use of it. */
             case AnchorType.LOOK_BEHIND_NOT:
@@ -2170,7 +2169,7 @@ final class Analyser extends Parser {
         oenv.mmd.clear(); // ??
         
         optimizeNodeLeft(node, opt, oenv);
-        
+
         regex.anchor = opt.anchor.leftAnchor & (AnchorType.BEGIN_BUF |
                                                 AnchorType.BEGIN_POSITION |
                                                 AnchorType.ANYCHAR_STAR |
diff --git a/src/org/joni/NodeOptInfo.java b/src/org/joni/NodeOptInfo.java
index b0e4026..20bc0bc 100644
--- a/src/org/joni/NodeOptInfo.java
+++ b/src/org/joni/NodeOptInfo.java
@@ -88,11 +88,13 @@ public final class NodeOptInfo {
         
         exm.select(other.exb, enc);
         exm.select(other.exm, enc);
-        
+
         if (expr.length > 0) {
             if (other.length.max > 0) {
-                if (expr.length > other.length.max) expr.length = other.length.max;
-                
+                // TODO: make sure it is not an Oniguruma bug (casting unsigned int to int for arithmetic comparison)
+                int otherLengthMax = other.length.max;
+                if (otherLengthMax == MinMaxLen.INFINITE_DISTANCE) otherLengthMax = -1;
+                if (expr.length > otherLengthMax) expr.length = otherLengthMax;
                 if (expr.mmd.max == 0) {
                     exb.select(expr, enc);
                 } else {
@@ -102,9 +104,8 @@ public final class NodeOptInfo {
         } else if (other.expr.length > 0) {
             expr.copy(other.expr);
         }
-        
+
         map.select(other.map);
-        
         length.add(other.length);
     }
     

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