Skip to content

AST structure is modified after being passed to listeners #1338

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

Closed
bwilkerson opened this issue Jan 25, 2012 · 3 comments
Closed

AST structure is modified after being passed to listeners #1338

bwilkerson opened this issue Jan 25, 2012 · 3 comments
Assignees
Labels
closed-obsolete Closed as the reported issue is no longer relevant

Comments

@bwilkerson
Copy link
Member

We need to have a contract that the AST structure passed in to DartCompilerListener.unitCompiled(DartUnit) will not subsequently be modified because clients (such as Editor) need to be able to count on the structure remaining stable. This is currently not the case, which is causing a ConcurrentModificationException to be thrown while attempting to index the structure.

I found one place where the structure can be modified after it is passed to clients: the method com.google.dart.compiler.backend.js.Normalizer.NormalizerVisitor.Let.visitClass(DartClass) adds a node for the implicit default constructor (assuming there is one) to the list of members in a class. There might be other places, but I decided not to try to track them down. The only other place I found where the DartClass.members list might be modified is through the method DartClass.traverse(DartVisitor, DartContext), which implies that the list can be modified by visitors, but I didn't try to trace through all of the visitors to see whether the list is actually modified by any of them. I didn't even look at other lists (this is the one that caused the exception).

@scheglov
Copy link
Contributor

Set owner to @scheglov.
Added Accepted label.

@scheglov
Copy link
Contributor

Marked this as being blocked by #590.

@DartBot
Copy link

DartBot commented Apr 3, 2012

This comment was originally written by zundel@google.com


The normalizer and all other backend stuff has been removed from dartc.


Added AssumedStale label.

@bwilkerson bwilkerson added Type-Defect closed-obsolete Closed as the reported issue is no longer relevant labels Apr 3, 2012
This issue was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
closed-obsolete Closed as the reported issue is no longer relevant
Projects
None yet
Development

No branches or pull requests

3 participants