RFR: 8301580: Error recovery does not clear returnResult [v2]
Vicente Romero
vromero at openjdk.org
Fri Feb 3 20:19:53 UTC 2023
On Fri, 3 Feb 2023 19:04:15 GMT, Jan Lahoda <jlahoda at openjdk.org> wrote:
>> src/jdk.compiler/share/classes/com/sun/tools/javac/comp/Attr.java line 5222:
>>
>>> 5220: public void visitErroneous(JCErroneous tree) {
>>> 5221: if (tree.errs != null) {
>>> 5222: Env<AttrContext> errEnv = env.dup(env.tree);
>>
>> question: shouldn't we do: `env.dup(node, env.info.dup());` instead, that way both env's won't share the info?
>
> I was a little bit on the fence on this, as some code, like `Attr.attribClass` stores and re-sets the result, while other dupes the info. Let's dupe the info then. Thanks!
I see, I didn't realize of the other pattern, not duping the info, we should probably standardize what we do at some point
-------------
PR: https://git.openjdk.org/jdk/pull/12361
More information about the compiler-dev
mailing list