Program: 133264
Project: 133264
Buggy source:
private static List<ComputedValue> updateReplacements(Instruction inst,State av,HierarchicalMap<String,Oparg> replaceInputs,HierarchicalMap<String,Oparg> replaceAll){
  List<ComputedValue> icvs=inst.getComputedValues(av.availableVals);
  if (icvs != null) {
    for (    ComputedValue currCV : icvs) {
      if (ComputedValue.isCopy(currCV)) {
        replaceInputs.put(currCV.getValLocation().getVar().getName(),currCV.getInput(0));
        continue;
      }
      Oparg currLoc=currCV.getValLocation();
      if (!av.isAvailable(currCV)) {
        av.addComputedValue(currCV,false);
      }
 else       if (currLoc.isConstant()) {
        Oparg prevLoc=av.getLocation(currCV);
        if (prevLoc.getType() == OpargType.VAR) {
          assert(Types.isScalarValue(prevLoc.getVar().getType()));
          av.addComputedValue(currCV,true);
          replaceInputs.put(prevLoc.getVar().getName(),currLoc);
        }
 else {
          assert(currLoc.equals(prevLoc));
        }
      }
 else {
        final boolean usePrev;
        assert(currLoc.getType() == OpargType.VAR);
        Oparg prevLoc=av.getLocation(currCV);
        if (prevLoc.isConstant()) {
          usePrev=true;
        }
 else {
          assert(prevLoc.getType() == OpargType.VAR);
          boolean currClosed=av.isClosed(currLoc.getVar().getName());
          boolean prevClosed=av.isClosed(prevLoc.getVar().getName());
          if (currCV.equivType == EquivalenceType.REFERENCE) {
            replaceAll.put(currLoc.getVar().getName(),prevLoc);
          }
          if (prevClosed || !currClosed) {
            usePrev=true;
          }
 else {
            usePrev=false;
          }
        }
        if (usePrev) {
          replaceInputs.put(currLoc.getVar().getName(),prevLoc);
        }
 else {
          replaceInputs.put(prevLoc.getVar().getName(),currLoc);
        }
      }
    }
  }
  return icvs;
}

Fixed version (ground truth):
private static List<ComputedValue> updateReplacements(Logger logger,Instruction inst,State av,HierarchicalMap<String,Oparg> replaceInputs,HierarchicalMap<String,Oparg> replaceAll){
  List<ComputedValue> icvs=inst.getComputedValues(av.availableVals);
  logger.trace("String_Node_Str");
  if (icvs != null) {
    logger.trace("String_Node_Str" + icvs.toString());
    for (    ComputedValue currCV : icvs) {
      if (ComputedValue.isCopy(currCV)) {
        replaceInputs.put(currCV.getValLocation().getVar().getName(),currCV.getInput(0));
        continue;
      }
      Oparg currLoc=currCV.getValLocation();
      if (!av.isAvailable(currCV)) {
        av.addComputedValue(currCV,false);
      }
 else       if (currLoc.isConstant()) {
        Oparg prevLoc=av.getLocation(currCV);
        if (prevLoc.getType() == OpargType.VAR) {
          assert(Types.isScalarValue(prevLoc.getVar().getType()));
          av.addComputedValue(currCV,true);
          replaceInputs.put(prevLoc.getVar().getName(),currLoc);
        }
 else {
          assert(currLoc.equals(prevLoc));
        }
      }
 else {
        final boolean usePrev;
        assert(currLoc.getType() == OpargType.VAR);
        Oparg prevLoc=av.getLocation(currCV);
        if (prevLoc.isConstant()) {
          usePrev=true;
        }
 else {
          assert(prevLoc.getType() == OpargType.VAR);
          boolean currClosed=av.isClosed(currLoc.getVar().getName());
          boolean prevClosed=av.isClosed(prevLoc.getVar().getName());
          if (currCV.equivType == EquivalenceType.REFERENCE) {
            replaceAll.put(currLoc.getVar().getName(),prevLoc);
          }
          if (prevClosed || !currClosed) {
            usePrev=true;
          }
 else {
            usePrev=false;
          }
        }
        if (usePrev) {
          replaceInputs.put(currLoc.getVar().getName(),prevLoc);
        }
 else {
          replaceInputs.put(prevLoc.getVar().getName(),currLoc);
        }
      }
    }
  }
  return icvs;
}