Do not hoist declarations of mutated variables
Status | Pipeline | Created by | Stages | Actions |
---|---|---|---|---|
Passed 00:00:53
| Stage: Code Quality Stage: Unit Tests Stage: legacy_test Stage: docs |
Download artifacts
No artifacts found |
Declarations/initializations of non-constant variables must not be hoisted from loops because it changes the semantics of the code.
For example:
for (...) {
int i = 0; // <- rhs is invariant but lhs is not
for (...) {
i += 1;
}
}
Previously got falsly transformed to:
int i = 0;
for (...) {
for (...) {
i += 1;
}
}
Status | Pipeline | Created by | Stages | Actions |
---|---|---|---|---|
Passed 00:00:53
| Stage: Code Quality Stage: Unit Tests Stage: legacy_test Stage: docs |
Download artifacts
No artifacts found |