Details
-
Bug
-
Resolution: Fixed
-
P3
-
None
-
None
-
b33
-
generic
-
generic
Backports
Issue | Fix Version | Assignee | Priority | Status | Resolution | Resolved In Build |
---|---|---|---|---|---|---|
JDK-8085730 | emb-9 | Attila Szegedi | P3 | Resolved | Fixed | team |
JDK-8064232 | 8u45 | Attila Szegedi | P3 | Resolved | Fixed | b01 |
JDK-8058883 | 8u40 | Attila Szegedi | P3 | Resolved | Fixed | b08 |
JDK-8070469 | emb-8u47 | Attila Szegedi | P3 | Resolved | Fixed | team |
Description
jjs $biwascheme/release/biwascheme-0.6.2.js
Exception in thread "main" java.lang.NullPointerException
at jdk.nashorn.internal.codegen.LocalVariableTypesCalculator$LvarType.access$100(LocalVariableTypesCalculator.java:119)
at jdk.nashorn.internal.codegen.LocalVariableTypesCalculator.symbolIsUsed(LocalVariableTypesCalculator.java:224)
at jdk.nashorn.internal.codegen.LocalVariableTypesCalculator.symbolIsUsed(LocalVariableTypesCalculator.java:1473)
at jdk.nashorn.internal.codegen.LocalVariableTypesCalculator.enterIdentNode(LocalVariableTypesCalculator.java:618)
at jdk.nashorn.internal.ir.IdentNode.accept(IdentNode.java:136)
at jdk.nashorn.internal.codegen.LocalVariableTypesCalculator.enterReturnNode(LocalVariableTypesCalculator.java:692)
at jdk.nashorn.internal.ir.ReturnNode.accept(ReturnNode.java:91)
at jdk.nashorn.internal.ir.Node.accept(Node.java:249)
at jdk.nashorn.internal.ir.Block.accept(Block.java:152)
at jdk.nashorn.internal.ir.LexicalContextNode$Acceptor.accept(LexicalContextNode.java:57)
at jdk.nashorn.internal.ir.Block.accept(Block.java:399)
at jdk.nashorn.internal.ir.FunctionNode.accept(FunctionNode.java:376)
at jdk.nashorn.internal.ir.LexicalContextNode$Acceptor.accept(LexicalContextNode.java:57)
at jdk.nashorn.internal.ir.LexicalContextExpression.accept(LexicalContextExpression.java:46)
at jdk.nashorn.internal.ir.FunctionNode.accept(FunctionNode.java:58)
at jdk.nashorn.internal.codegen.LocalVariableTypesCalculator$1.leaveFunctionNode(LocalVariableTypesCalculator.java:1238)
at jdk.nashorn.internal.ir.FunctionNode.accept(FunctionNode.java:376)
at jdk.nashorn.internal.ir.LexicalContextNode$Acceptor.accept(LexicalContextNode.java:57)
at jdk.nashorn.internal.ir.LexicalContextExpression.accept(LexicalContextExpression.java:46)
at jdk.nashorn.internal.ir.FunctionNode.accept(FunctionNode.java:58)
at jdk.nashorn.internal.ir.PropertyNode.accept(PropertyNode.java:88)
at jdk.nashorn.internal.ir.Node.accept(Node.java:249)
at jdk.nashorn.internal.ir.ObjectNode.accept(ObjectNode.java:64)
at jdk.nashorn.internal.ir.Node.accept(Node.java:249)
at jdk.nashorn.internal.ir.CallNode.accept(CallNode.java:178)
at jdk.nashorn.internal.ir.LexicalContextNode$Acceptor.accept(LexicalContextNode.java:57)
at jdk.nashorn.internal.ir.LexicalContextExpression.accept(LexicalContextExpression.java:46)
at jdk.nashorn.internal.ir.CallNode.accept(CallNode.java:41)
at jdk.nashorn.internal.ir.BinaryNode.accept(BinaryNode.java:341)
at jdk.nashorn.internal.ir.BinaryNode.accept(BinaryNode.java:341)
at jdk.nashorn.internal.ir.ExpressionStatement.accept(ExpressionStatement.java:62)
at jdk.nashorn.internal.ir.Node.accept(Node.java:249)
at jdk.nashorn.internal.ir.Block.accept(Block.java:152)
at jdk.nashorn.internal.ir.LexicalContextNode$Acceptor.accept(LexicalContextNode.java:57)
at jdk.nashorn.internal.ir.Block.accept(Block.java:399)
at jdk.nashorn.internal.ir.SplitNode.accept(SplitNode.java:94)
at jdk.nashorn.internal.ir.LexicalContextNode$Acceptor.accept(LexicalContextNode.java:57)
at jdk.nashorn.internal.ir.LexicalContextStatement.accept(LexicalContextStatement.java:53)
at jdk.nashorn.internal.ir.SplitNode.accept(SplitNode.java:41)
at jdk.nashorn.internal.ir.Node.accept(Node.java:249)
at jdk.nashorn.internal.ir.Block.accept(Block.java:152)
at jdk.nashorn.internal.ir.LexicalContextNode$Acceptor.accept(LexicalContextNode.java:57)
at jdk.nashorn.internal.ir.Block.accept(Block.java:399)
at jdk.nashorn.internal.codegen.LocalVariableTypesCalculator.leaveFunctionNode(LocalVariableTypesCalculator.java:1294)
at jdk.nashorn.internal.ir.FunctionNode.accept(FunctionNode.java:376)
at jdk.nashorn.internal.ir.LexicalContextNode$Acceptor.accept(LexicalContextNode.java:57)
at jdk.nashorn.internal.ir.LexicalContextExpression.accept(LexicalContextExpression.java:46)
at jdk.nashorn.internal.ir.FunctionNode.accept(FunctionNode.java:58)
at jdk.nashorn.internal.codegen.CompilationPhase$9.transform(CompilationPhase.java:279)
at jdk.nashorn.internal.codegen.CompilationPhase.apply(CompilationPhase.java:703)
at jdk.nashorn.internal.codegen.Compiler.compile(Compiler.java:560)
at jdk.nashorn.internal.runtime.Context.compile(Context.java:1159)
at jdk.nashorn.internal.runtime.Context.compileScript(Context.java:1098)
at jdk.nashorn.internal.runtime.Context.compileScript(Context.java:543)
at jdk.nashorn.tools.Shell.runScripts(Shell.java:317)
at jdk.nashorn.tools.Shell.run(Shell.java:169)
at jdk.nashorn.tools.Shell.main(Shell.java:133)
at jdk.nashorn.tools.Shell.main(Shell.java:112)
Based on some println debugging, I think I managed to reduce this to simple script below:
function func(x, y) {
while(true) {
switch (y[0]) {
case "bar":
x = 'xxx';
break;
}
}
return x;
}
If you turn on asserts with -J-ea, we get the following trace:
Exception in thread "main" java.lang.AssertionError
at jdk.nashorn.internal.codegen.LocalVariableTypesCalculator.getLocalVariableType(LocalVariableTypesCalculator.java:998)
at jdk.nashorn.internal.codegen.LocalVariableTypesCalculator.symbolIsUsed(LocalVariableTypesCalculator.java:1473)
at jdk.nashorn.internal.codegen.LocalVariableTypesCalculator.enterIdentNode(LocalVariableTypesCalculator.java:618)
at jdk.nashorn.internal.ir.IdentNode.accept(IdentNode.java:136)
at jdk.nashorn.internal.codegen.LocalVariableTypesCalculator.enterReturnNode(LocalVariableTypesCalculator.java:692)
at jdk.nashorn.internal.ir.ReturnNode.accept(ReturnNode.java:91)
at jdk.nashorn.internal.ir.Node.accept(Node.java:249)
at jdk.nashorn.internal.ir.Block.accept(Block.java:152)
at jdk.nashorn.internal.ir.LexicalContextNode$Acceptor.accept(LexicalContextNode.java:57)
at jdk.nashorn.internal.ir.Block.accept(Block.java:399)
at jdk.nashorn.internal.ir.FunctionNode.accept(FunctionNode.java:376)
at jdk.nashorn.internal.ir.LexicalContextNode$Acceptor.accept(LexicalContextNode.java:57)
at jdk.nashorn.internal.ir.LexicalContextExpression.accept(LexicalContextExpression.java:46)
at jdk.nashorn.internal.ir.FunctionNode.accept(FunctionNode.java:58)
at jdk.nashorn.internal.codegen.LocalVariableTypesCalculator$1.leaveFunctionNode(LocalVariableTypesCalculator.java:1238)
at jdk.nashorn.internal.ir.FunctionNode.accept(FunctionNode.java:376)
at jdk.nashorn.internal.ir.LexicalContextNode$Acceptor.accept(LexicalContextNode.java:57)
at jdk.nashorn.internal.ir.LexicalContextExpression.accept(LexicalContextExpression.java:46)
at jdk.nashorn.internal.ir.FunctionNode.accept(FunctionNode.java:58)
at jdk.nashorn.internal.ir.VarNode.accept(VarNode.java:171)
at jdk.nashorn.internal.ir.Node.accept(Node.java:249)
at jdk.nashorn.internal.ir.Block.accept(Block.java:152)
at jdk.nashorn.internal.ir.LexicalContextNode$Acceptor.accept(LexicalContextNode.java:57)
at jdk.nashorn.internal.ir.Block.accept(Block.java:399)
at jdk.nashorn.internal.codegen.LocalVariableTypesCalculator.leaveFunctionNode
[... more frames...]
Attachments
Issue Links
- backported by
-
JDK-8058883 NullPointerException at jdk.nashorn.internal.codegen.LocalVariableTypesCalculator.symbolIsUsed(LocalVariableTypesCalculator.java:224)
-
- Resolved
-
-
JDK-8064232 NullPointerException at jdk.nashorn.internal.codegen.LocalVariableTypesCalculator.symbolIsUsed(LocalVariableTypesCalculator.java:224)
-
- Resolved
-
-
JDK-8070469 NullPointerException at jdk.nashorn.internal.codegen.LocalVariableTypesCalculator.symbolIsUsed(LocalVariableTypesCalculator.java:224)
-
- Resolved
-
-
JDK-8085730 NullPointerException at jdk.nashorn.internal.codegen.LocalVariableTypesCalculator.symbolIsUsed(LocalVariableTypesCalculator.java:224)
-
- Resolved
-
- duplicates
-
JDK-8059138 Optimistic typing turned off crashes Nashorn
-
- Resolved
-