Skip to content
Commits on Source (6)
......@@ -4,7 +4,7 @@
<groupId>org.jruby.joni</groupId>
<artifactId>joni</artifactId>
<packaging>jar</packaging>
<version>2.1.26-SNAPSHOT</version>
<version>2.1.27-SNAPSHOT</version>
<name>Joni</name>
<description>
Java port of Oniguruma: http://www.geocities.jp/kosako3/oniguruma
......@@ -66,7 +66,7 @@
<dependency>
<groupId>org.jruby.jcodings</groupId>
<artifactId>jcodings</artifactId>
<version>1.0.41</version>
<version>1.0.43</version>
</dependency>
<dependency>
<groupId>junit</groupId>
......
......@@ -1320,6 +1320,7 @@ class ByteCodeMachine extends StackMachine {
private void opMemoryStart() {
int mem = code[ip++];
repeatStk[memStartStk + mem] = s;
repeatStk[memEndStk + mem] = -1;
}
private void opMemoryEndPush() {
......
This diff is collapsed.
......@@ -33,7 +33,7 @@ public final class StringNode extends Node implements StringType {
public int end;
public int flag;
private StringNode(int size) {
public StringNode(int size) {
super(STR);
this.bytes = new byte[size];
}
......
......@@ -71,6 +71,7 @@ public class TestError extends Test {
xerrs("a{5,1}", ErrorMessages.UPPER_SMALLER_THAN_LOWER_IN_REPEAT_RANGE);
xerrs("[\\6000", ErrorMessages.TOO_BIG_NUMBER); // CVE-2017-9226
xerrs("[\\H- ]", ErrorMessages.UNMATCHED_RANGE_SPECIFIER_IN_CHAR_CLASS); // CVE-2017-9228
xerrs("[a-\\d]", ErrorMessages.CHAR_CLASS_VALUE_AT_END_OF_RANGE);
xerrs("(?:ab|cd)*\\1", ErrorMessages.INVALID_BACKREF);
xerrs("(ab|cd)*\\1", ErrorMessages.INVALID_BACKREF, Option.DONT_CAPTURE_GROUP);
......@@ -85,6 +86,7 @@ public class TestError extends Test {
xerrs("\\k<1/>", ErrorMessages.INVALID_GROUP_NAME.replace("%n", "1/"));
// xerrs("\\k<1-1/>", ErrorMessages.ERR_INVALID_GROUP_NAME.replace("%n", "1-1/>"));
// xerrs("\\k<a/>", ErrorMessages.ERR_INVALID_CHAR_IN_GROUP_NAME.replace("%n", "a/"));
// xerrs("\\g<1>", ErrorMessages.UNDEFINED_GROUP_REFERENCE);
xerrs("*", ErrorMessages.TARGET_OF_REPEAT_OPERATOR_NOT_SPECIFIED);
xerrs("{1}", ErrorMessages.TARGET_OF_REPEAT_OPERATOR_NOT_SPECIFIED);
......@@ -95,5 +97,7 @@ public class TestError extends Test {
xerrs("()(?(2))", ErrorMessages.INVALID_BACKREF);
xerrs("(?(700000))", ErrorMessages.INVALID_BACKREF);
xerrs("(?<!a(?:bb|c))", ErrorMessages.INVALID_LOOK_BEHIND_PATTERN);
}
}
......@@ -320,6 +320,7 @@ public class TestU8 extends Test {
x2s("(?~abc|def)x", "abcx", 1, 4);
x2s("(?~abc|def)x", "defx", 1, 4);
x2s("^(?~\\S+)TEST", "TEST", 0, 4);
x3s("(?~(a)c)", "aab", -1, -1, 1); // # $1 should not match.
x2s("𠜎𠜱", "𠜎𠜱", 0, 8);
x2s("𠜎?𠜱", "𠜎𠜱", 0, 8);
......