Skip to content

Commit

Permalink
Handling error with ERR search
Browse files Browse the repository at this point in the history
  • Loading branch information
leventeBajczi committed Nov 22, 2022
1 parent 7e400d7 commit fc306c1
Showing 1 changed file with 3 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -54,8 +54,8 @@ public XcfaDistToErrComparator(final XCFA xcfa, final int errorWeight, final int
this.xcfa = xcfa;
Pair<XcfaProcedure, List<Expr<?>>> initProc = checkNotNull(xcfa.getInitProcedures().get(0));
Optional<XcfaLocation> errorLocOpt = initProc.component1().getErrorLoc();
checkState(errorLocOpt.isPresent());
this.errLoc = errorLocOpt.get();
// checkState(errorLocOpt.isPresent());
this.errLoc = errorLocOpt.orElse(null);
this.errorWeight = errorWeight;
this.depthWeight = depthWeight;
distancesToError = null;
Expand All @@ -82,7 +82,7 @@ private int getWeightedDistance(final ArgNode<? extends State, ? extends Action>
}

private int getDistanceToError(final XcfaLocation loc) {
if (distancesToError == null) {
if (distancesToError == null && errLoc != null) {
distancesToError = calculateDistancesToError(xcfa, errLoc);
} else if (errLoc == null) {
return Integer.MAX_VALUE;
Expand Down

0 comments on commit fc306c1

Please sign in to comment.