-
Bug
-
Resolution: Fixed
-
P3
-
None
-
b20
-
Verified
Due to numerical overflow the following code throws NegativeArraySizeException instead of OutOfMemoryError:
import java.util.regex.*;
public class T {
public static void main(String[] args) throws Throwable {
Pattern.compile("\\Q" + "a".repeat(Integer.MAX_VALUE / 3 + 42));
}
}
The test requires extra memory to hold a large pattern, so it needs to be run with -Xmx5G at least.
import java.util.regex.*;
public class T {
public static void main(String[] args) throws Throwable {
Pattern.compile("\\Q" + "a".repeat(Integer.MAX_VALUE / 3 + 42));
}
}
The test requires extra memory to hold a large pattern, so it needs to be run with -Xmx5G at least.