-
Notifications
You must be signed in to change notification settings - Fork 109
Closed
Description
Linq4j BlockBuilder incorrectly inlines a variable that might be assigned more than once along a code path. For example, in
long x = 0;
final long y = System.currentTimeMillis();
if (System.nanoTime() > 0L) {
x = y;
}
it incorrectly inlines x
, to yield
if (System.nanoTime() > 0L) {
System.currentTimeMillis();
}
The fix is to only inline variables that are marked 'final'. The java compiler will ensure that they cannot be assigned more than once (by any code path) and cannot be read before they have been initialized.
This change may break code that relies on Linq4j inlining effectively final (but not explicitly final) variables.
Metadata
Metadata
Assignees
Labels
No labels