[8u] RFR: 8204290: Add check to limit number of capture groups

Severin Gehwolf sgehwolf at redhat.com
Mon Nov 18 18:11:39 UTC 2019


Hi,

Could I please get a review of this OpenJDK 8u backport of JDK-8204290
for Oracle JDK 8u24x parity? The JDK 11 patch is the same exept for
these test changes (and modulo path changes):

This:

    new RegExp("()".repeat(0x8001));
    fail("Expected exception");

became:

    var captureGroups = "";
    for (i=0; i < 0x8001; i++) { captureGroups = captureGroups + "()"; }
    new RegExp(captureGroups);
    fail("Expected exception");

String.repeat() is a JDK 11 feature. Results in:

<shell>:1 TypeError: "()".repeat is not a function

Bug: https://bugs.openjdk.java.net/browse/JDK-8204290
webrev: http://cr.openjdk.java.net/~sgehwolf/webrevs/JDK-8204290/01/webrev/

Testing: nashorn tests. New regresstion test passes. Manual testing with jjs.

Thoughts?

Thanks,
Severin



More information about the jdk8u-dev mailing list