RFR: 8043179: Lambda expression can mutate final field [v10]
Archie L. Cobbs
duke at openjdk.org
Thu Oct 20 00:40:15 UTC 2022
> (Description revised)
>
> JDK-8043176 updated the JLS 16.1.10 to describe how within a lambda body, any variables that were DU before the lambda expression must not be considered DU at the start of the lambda block, because arbitrary code could have executed in the meantime:
>
>> _No rule allows V to be definitely unassigned before a lambda body. This is by design: a variable that was definitely unassigned before the lambda body may end up being assigned to later on, so we cannot conclude that the variable will be unassigned when the body is executed._
>
> This fix to `Flow.AssignAnalyzer` follows in a straightforward way: mark all variables as not DU before recursing into the lambda body.
Archie L. Cobbs has updated the pull request incrementally with one additional commit since the last revision:
Update failed test output line numbers after removing @author tags.
-------------
Changes:
- all: https://git.openjdk.org/jdk/pull/10381/files
- new: https://git.openjdk.org/jdk/pull/10381/files/b1d5b3c9..0081d190
Webrevs:
- full: https://webrevs.openjdk.org/?repo=jdk&pr=10381&range=09
- incr: https://webrevs.openjdk.org/?repo=jdk&pr=10381&range=08-09
Stats: 2 lines in 2 files changed: 0 ins; 0 del; 2 mod
Patch: https://git.openjdk.org/jdk/pull/10381.diff
Fetch: git fetch https://git.openjdk.org/jdk pull/10381/head:pull/10381
PR: https://git.openjdk.org/jdk/pull/10381
More information about the compiler-dev
mailing list