LiveVariablesAnalyzer#findLiveVars: clone or'ed BitSet as well

We should ensure that runDFA lambda never returns an object which will be mutated afterwards as this object used as part of `processed` Set key (inside InstructionState).
This commit is contained in:
Tagir Valeev
2017-09-01 17:34:31 +07:00
parent 99c0e6c3f4
commit 6fdfa74fac
@@ -146,8 +146,9 @@ public class LiveVariablesAnalyzer {
BitSet set = result.get(instruction);
if (set != null) {
set.or(liveVars);
return set;
} else {
return (BitSet)set.clone();
}
else if (!liveVars.isEmpty()) {
result.put((FinishElementInstruction)instruction, (BitSet)liveVars.clone());
}
}