From: rtrimana Date: Mon, 2 Mar 2020 22:12:31 +0000 (-0800) Subject: Fixing a bug: merging the analysis part for locationMode w.r.t manual interaction... X-Git-Url: http://demsky.eecs.uci.edu/git/?a=commitdiff_plain;h=799575b441362e153c9ca7f15e520c3d9b3f3b80;p=jpf-core.git Fixing a bug: merging the analysis part for locationMode w.r.t manual interaction flag. --- diff --git a/src/main/gov/nasa/jpf/listener/ConflictTracker.java b/src/main/gov/nasa/jpf/listener/ConflictTracker.java index 9d2cd19..384056e 100644 --- a/src/main/gov/nasa/jpf/listener/ConflictTracker.java +++ b/src/main/gov/nasa/jpf/listener/ConflictTracker.java @@ -593,37 +593,22 @@ public class ConflictTracker extends ListenerAdapter { } if (conflictFound) { + StringBuilder sb = new StringBuilder(); sb.append(errorMessage); Instruction nextIns = ti.createAndThrowException("java.lang.RuntimeException", sb.toString()); ti.setNextPC(nextIns); - } else if (conflictSet.contains(LOCATION_VAR)) { - MethodInfo mi = executedInsn.getMethodInfo(); - // Find the last load before return and get the value here - if (mi.getName().equals(SET_LOCATION_METHOD) && - executedInsn instanceof ALOAD && nextInsn instanceof ARETURN) { - byte type = getType(ti, executedInsn); - String value = getValue(ti, executedInsn, type); - - // Extract the writer app name - ClassInfo ci = mi.getClassInfo(); - String writer = ci.getName(); - - // Update the temporary Set set. - writeWriterAndValue(writer, LOCATION_VAR, value); - } } else { + if (executedInsn instanceof WriteInstruction) { String varId = ((WriteInstruction) executedInsn).getFieldInfo().getFullName(); - - // Check if we have an update to isManualTransaction to update manual field - if (varId.contains("isManualTransaction")) { - byte type = getType(ti, executedInsn); - String value = getValue(ti, executedInsn, type); - - manual = (value.equals("true"))?true:false; - } - + // Check if we have an update to isManualTransaction to update manual field + if (varId.contains("isManualTransaction")) { + byte type = getType(ti, executedInsn); + String value = getValue(ti, executedInsn, type); + System.out.println(); + manual = (value.equals("true"))?true:false; + } for (String var : conflictSet) { if (varId.contains(var)) { // Get variable info