Skip to content

Commit 921e208

Browse files
committed
Fix implementation of PC instruction
1 parent 69e3a8b commit 921e208

File tree

1 file changed

+2
-6
lines changed

1 file changed

+2
-6
lines changed

src/main/java/it/unipr/cfg/Pc.java

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -44,11 +44,7 @@ public String toString() {
4444
public <A extends AbstractState<A>> AnalysisState<A> forwardSemantics(AnalysisState<A> entryState,
4545
InterproceduralAnalysis<A> interprocedural, StatementStore<A> expressions) throws SemanticException {
4646

47-
// we can safely suppose that there exists just one node incoming to
48-
// this node
49-
Statement incomingNode = getCFG().getIngoingEdges(this).stream().map(t -> t.getSource()).findAny().get();
50-
51-
Constant pc = new Constant(Untyped.INSTANCE, ((ProgramCounterLocation) incomingNode.getLocation()).getPc(),
47+
Constant pc = new Constant(Untyped.INSTANCE, ((ProgramCounterLocation) getLocation()).getPc(),
5248
getLocation());
5349
return entryState.smallStepSemantics(new it.unive.lisa.symbolic.value.UnaryExpression(Untyped.INSTANCE, pc,
5450
PcOperator.INSTANCE, getLocation()), this);
@@ -59,4 +55,4 @@ protected int compareSameClass(Statement o) {
5955
// we cannot have more than one statement on the same code location
6056
return 0;
6157
}
62-
}
58+
}

0 commit comments

Comments
 (0)