mirror of
https://github.com/darlinghq/darling-openjdk.git
synced 2025-02-22 09:11:05 +00:00
8169481: StackOverflowError on start when parsing PAC file to autodetect Proxy settings
Reviewed-by: jlaskey, sundar
This commit is contained in:
parent
b659f6d8f4
commit
9d1a6b4fa0
@ -77,6 +77,7 @@ final class WeighNodes extends NodeOperatorVisitor<LexicalContext> {
|
||||
static final long CALL_WEIGHT = 10;
|
||||
static final long CATCH_WEIGHT = 10;
|
||||
static final long COMPARE_WEIGHT = 6;
|
||||
static final long CONST_WEIGHT = 2;
|
||||
static final long CONTINUE_WEIGHT = 1;
|
||||
static final long IF_WEIGHT = 2;
|
||||
static final long LITERAL_WEIGHT = 10;
|
||||
@ -185,7 +186,7 @@ final class WeighNodes extends NodeOperatorVisitor<LexicalContext> {
|
||||
|
||||
@Override
|
||||
public Node leaveIdentNode(final IdentNode identNode) {
|
||||
weight += ACCESS_WEIGHT + identNode.getName().length() * 2;
|
||||
weight += ACCESS_WEIGHT;
|
||||
return identNode;
|
||||
}
|
||||
|
||||
@ -210,6 +211,11 @@ final class WeighNodes extends NodeOperatorVisitor<LexicalContext> {
|
||||
@SuppressWarnings("rawtypes")
|
||||
@Override
|
||||
public boolean enterLiteralNode(final LiteralNode literalNode) {
|
||||
if (literalNode instanceof LiteralNode.PrimitiveLiteralNode) {
|
||||
weight += CONST_WEIGHT;
|
||||
return false;
|
||||
}
|
||||
|
||||
weight += LITERAL_WEIGHT;
|
||||
|
||||
if (literalNode instanceof ArrayLiteralNode) {
|
||||
|
@ -31,7 +31,7 @@
|
||||
var str = "";
|
||||
|
||||
// large code to force splitting
|
||||
for (i = 0; i < 1000; ++i)
|
||||
for (i = 0; i < 2000; ++i)
|
||||
str +="o = new Object()\n";
|
||||
|
||||
str +="g()";
|
||||
|
1043
nashorn/test/script/basic/JDK-8169481.js
Normal file
1043
nashorn/test/script/basic/JDK-8169481.js
Normal file
File diff suppressed because it is too large
Load Diff
Loading…
x
Reference in New Issue
Block a user