Skip to content

Commit

Permalink
Fix for JRUBY-6682 (jgem search -r ak ' causes exceptions.)
Browse files Browse the repository at this point in the history
  • Loading branch information
lopex committed Jul 3, 2012
1 parent cf3f6e9 commit e7d1f0b
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/org/joni/ByteCodeMachine.java
Expand Up @@ -526,7 +526,7 @@ private void opExactMB2N3() {

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++]];
Expand All @@ -551,7 +551,7 @@ private void opExactMB2N() {

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++]];
Expand Down
1 change: 1 addition & 0 deletions test/org/joni/test/TestU8.java
Expand Up @@ -75,6 +75,7 @@ public void 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 {
Expand Down

0 comments on commit e7d1f0b

Please sign in to comment.