Skip to content

Commit 5c77c2e

Browse files
committed
Fix multiplex backreferences near end of string in regexp match
See https://bugs.ruby-lang.org/issues/18631 See ruby/ruby#5710
1 parent 33f8580 commit 5c77c2e

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/org/joni/ByteCodeMachine.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1442,7 +1442,7 @@ private void opBackRefMulti() {
14421442
int pend = backrefEnd(mem);
14431443

14441444
int n = pend - pstart;
1445-
if (s + n > range) {opFail(); return;}
1445+
if (s + n > range) continue;
14461446

14471447
sprev = s;
14481448
int swork = s;
@@ -1478,7 +1478,7 @@ private void opBackRefMultiIC() {
14781478
int pend = backrefEnd(mem);
14791479

14801480
int n = pend - pstart;
1481-
if (s + n > range) {opFail(); return;}
1481+
if (s + n > range) continue;
14821482

14831483
sprev = s;
14841484

0 commit comments

Comments
 (0)