C backend: fix bugs in exception handling transformer

This commit is contained in:
Alexey Andreev 2018-05-05 22:03:20 +03:00
parent 52ddd96c7d
commit ff07b28bee
2 changed files with 2 additions and 2 deletions

View File

@ -395,7 +395,7 @@ public class ExceptionHandlingShadowStackContributor {
if (outgoingVariablesToRemove.contains(incoming.getValue().getIndex())) { if (outgoingVariablesToRemove.contains(incoming.getValue().getIndex())) {
phi.getIncomings().remove(i--); phi.getIncomings().remove(i--);
break; break;
} else if (incoming.getValue().getIndex() == value) { } else if (incoming.getValue().getIndex() == value && incoming.getSource() != newBlock) {
if (variablesDefinedHere.contains(value)) { if (variablesDefinedHere.contains(value)) {
incoming.setSource(newBlock); incoming.setSource(newBlock);
} else { } else {

View File

@ -144,7 +144,7 @@ public class BasicBlockSplitter {
DefinitionExtractor defExtractor = new DefinitionExtractor(); DefinitionExtractor defExtractor = new DefinitionExtractor();
for (BasicBlock block : sourceParts) { for (BasicBlock block : sourceParts) {
if (block != null) { if (block != source) {
for (Map.Entry<Phi, Variable> lastDefinedEntry : lastDefinedValues.entrySet()) { for (Map.Entry<Phi, Variable> lastDefinedEntry : lastDefinedValues.entrySet()) {
Incoming incomingCopy = new Incoming(); Incoming incomingCopy = new Incoming();
incomingCopy.setSource(block); incomingCopy.setSource(block);