Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

IllegalStateException in VarCheck: Unexpected variable #2842

Open
rohanpadhye opened this issue Mar 10, 2018 · 3 comments
Labels

Comments

@rohanpadhye
Copy link

@rohanpadhye rohanpadhye commented Mar 10, 2018

Input for SIMPLE_OPTIMIZATIONS:

while ((l_0)){ while ((l_0)){ if ((l_0)) { break;;var l_0;continue }{ break;var l_0 } } }

Throws:

Unexpected variable l_0
  Node(NAME l_0): stdin:1:8
while ((l_0)){ while ((l_0)){ if ((l_0)) { break;;var l_0;continue }{ break;var l_0 } } }
  Parent(FOR): stdin:1:0
while ((l_0)){ while ((l_0)){ if ((l_0)) { break;;var l_0;continue }{ break;var l_0 } } }

	at com.google.javascript.jscomp.VarCheck.visit(VarCheck.java:222)
	at com.google.javascript.jscomp.NodeTraversal.traverseBranch(NodeTraversal.java:772)
	at com.google.javascript.jscomp.NodeTraversal.traverseChildren(NodeTraversal.java:843)
	at com.google.javascript.jscomp.NodeTraversal.traverseBlockScope(NodeTraversal.java:858)
	at com.google.javascript.jscomp.NodeTraversal.traverseBranch(NodeTraversal.java:766)
	at com.google.javascript.jscomp.NodeTraversal.traverseChildren(NodeTraversal.java:843)
	at com.google.javascript.jscomp.NodeTraversal.handleScript(NodeTraversal.java:724)
	at com.google.javascript.jscomp.NodeTraversal.traverseBranch(NodeTraversal.java:749)
	at com.google.javascript.jscomp.NodeTraversal.traverseChildren(NodeTraversal.java:843)
	at com.google.javascript.jscomp.NodeTraversal.traverseBranch(NodeTraversal.java:768)
	at com.google.javascript.jscomp.NodeTraversal.traverseRoots(NodeTraversal.java:323)
	at com.google.javascript.jscomp.VarCheck.process(VarCheck.java:145)
	at com.google.javascript.jscomp.PhaseOptimizer$NamedPass.process(PhaseOptimizer.java:303)
	at com.google.javascript.jscomp.PhaseOptimizer.process(PhaseOptimizer.java:230)
	at com.google.javascript.jscomp.Compiler.performOptimizations(Compiler.java:2541)
	at com.google.javascript.jscomp.Compiler$3.call(Compiler.java:833)
	at com.google.javascript.jscomp.Compiler$3.call(Compiler.java:829)
	at com.google.javascript.jscomp.CompilerExecutor$2.call(CompilerExecutor.java:101)
	at java.util.concurrent.FutureTask.run(FutureTask.java:266)
	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
	at java.lang.Thread.run(Thread.java:748)
Caused by: java.lang.IllegalStateException: Unexpected variable l_0

Affects: v20180204 and current SNAPSHOT

Test-case was automatically generated using JQF.

@rohanpadhye rohanpadhye changed the title IllegalStateException: Unexpected variable IllegalStateException in VarCheck: Unexpected variable Mar 10, 2018
@MatrixFrog

This comment has been minimized.

Copy link
Contributor

@MatrixFrog MatrixFrog commented Mar 10, 2018

Cool! We've tried a couple fuzzing tools before but I don't think we were very successful at finding compiler bugs. We should look into this one more.

@brad4d brad4d added bug P3 labels Mar 23, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
4 participants
You can’t perform that action at this time.