Java: Don't construct nonsense SSA for unreachable code.

This commit is contained in:
Anders Schack-Mulligen
2018-11-06 16:42:09 +01:00
parent 2846d80f1c
commit fa3fa33c51
2 changed files with 6 additions and 3 deletions

View File

@@ -225,7 +225,8 @@ private module SsaImpl {
cached
predicate certainVariableUpdate(TrackedVar v, ControlFlowNode n, BasicBlock b, int i) {
exists(VariableUpdate a | a = n | getDestVar(a) = v) and
b.getNode(i) = n
b.getNode(i) = n and
hasDominanceInformation(b)
or
certainVariableUpdate(v.getQualifier(), n, b, i)
}
@@ -559,7 +560,8 @@ private module SsaImpl {
cached
predicate uncertainVariableUpdate(TrackedVar v, ControlFlowNode n, BasicBlock b, int i) {
exists(Call c | c = n | updatesNamedField(c, v, _)) and
b.getNode(i) = n
b.getNode(i) = n and
hasDominanceInformation(b)
or
uncertainVariableUpdate(v.getQualifier(), n, b, i)
}

View File

@@ -72,7 +72,8 @@ private module SsaImpl {
cached
predicate variableUpdate(BaseSsaSourceVariable v, ControlFlowNode n, BasicBlock b, int i) {
exists(VariableUpdate a | a = n | getDestVar(a) = v) and
b.getNode(i) = n
b.getNode(i) = n and
hasDominanceInformation(b)
}
/** Gets the definition point of a nested class in the parent scope. */