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())) {
phi.getIncomings().remove(i--);
break;
} else if (incoming.getValue().getIndex() == value) {
} else if (incoming.getValue().getIndex() == value && incoming.getSource() != newBlock) {
if (variablesDefinedHere.contains(value)) {
incoming.setSource(newBlock);
} else {

View File

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