RFR(12): JDK-8207229: Trees.getScope crashes for broken lambda; JDK-8207230: Trees.getScope runs Analyzers
Jan Lahoda
jan.lahoda at oracle.com
Fri Jul 13 16:43:50 UTC 2018
Hi,
The proposed patch attempts to fix two problems with Trees.getScope:
-a NPE when a lambda is categorized as an implicit lambda, but has a
parameter with type (in erroneous source); when
Attr.fallbackDescriptorType constructs the fallback descriptor, it uses
the (unattributed) type of the parameter, which then leads to the NPE.
The proposal is to check if the type of the parameter is present, and
use syms.errType if not present.
-Analyzers appear to run while the Scope is being computed by
Trees.getScope. This does not seem necessary (as the attribution
typically runs on a copy of the AST, not on the real AST).
Bugs:
https://bugs.openjdk.java.net/browse/JDK-8207229
https://bugs.openjdk.java.net/browse/JDK-8207230
Webrev:
http://cr.openjdk.java.net/~jlahoda/8207229/webrev.00/
Does this look reasonable?
Thanks,
Jan
More information about the compiler-dev
mailing list