Program: 132863
Project: 132863
Buggy source:
private void replaceVals(GlobalConstants consts,Block block,Map<Block,Congruences> congruences,InitState init){
  Congruences state=congruences.get(block);
  if (logger.isTraceEnabled()) {
    logger.trace("String_Node_Str");
    logger.trace("String_Node_Str" + System.identityHashCode(block) + "String_Node_Str"+ block.getType());
    state.printTraceInfo(logger,consts);
  }
  ListIterator<Statement> stmtIt=block.statementIterator();
  while (stmtIt.hasNext()) {
    Statement stmt=stmtIt.next();
    if (stmt.type() == StatementType.INSTRUCTION) {
      Instruction inst=stmt.instruction();
      replaceCongruent(inst,state,init);
      if (!inst.hasSideEffects() && inst.getOutputs().size() == 1) {
        Var output=inst.getOutput(0);
        if (!InitVariables.varMustBeInitialized(output,true) || init.isInitialized(output,true)) {
          if (Types.isScalarFuture(output)) {
            Arg val=state.findRetrieveResult(output);
            if (val != null) {
              Instruction futureSet=ICInstructions.futureSet(output,val);
              stmtIt.set(futureSet);
              logger.trace("String_Node_Str" + futureSet);
            }
          }
 else           if (Types.isScalarValue(output)) {
            Arg val=state.findValue(output);
            if (val != null && val.isConstant()) {
              Instruction valueSet=ICInstructions.valueSet(output,val);
              stmtIt.set(valueSet);
              logger.trace("String_Node_Str" + valueSet);
            }
          }
        }
      }
      InitVariables.updateInitVars(logger,stmt,init,false);
    }
 else {
      assert(stmt.type() == StatementType.CONDITIONAL);
      replaceCongruentNonRec(stmt.conditional(),state,init);
      replaceValsRec(consts,stmt.conditional(),congruences,init);
    }
  }
  replaceCleanupCongruent(block,state,init);
  for (  Continuation cont : block.getContinuations()) {
    replaceCongruentNonRec(cont,state,init);
    replaceValsRec(consts,cont,congruences,init);
  }
}

Fixed version (ground truth):
private void replaceVals(GlobalConstants consts,Block block,Map<Block,Congruences> congruences,InitState init){
  Congruences state=congruences.get(block);
  if (logger.isTraceEnabled()) {
    logger.trace("String_Node_Str");
    logger.trace("String_Node_Str" + System.identityHashCode(block) + "String_Node_Str"+ block.getType());
    state.printTraceInfo(logger,consts);
  }
  ListIterator<Statement> stmtIt=block.statementIterator();
  while (stmtIt.hasNext()) {
    Statement stmt=stmtIt.next();
    if (stmt.type() == StatementType.INSTRUCTION) {
      Instruction inst=stmt.instruction();
      replaceCongruent(inst,state,init);
      if (!inst.hasSideEffects() && inst.getOutputs().size() == 1) {
        Var output=inst.getOutput(0);
        if (!InitVariables.varMustBeInitialized(output,true) || init.isInitialized(output,true)) {
          if (Types.isScalarFuture(output)) {
            Arg val=state.findRetrieveResult(output);
            if (val != null && init.isInitialized(val,false)) {
              Instruction futureSet=ICInstructions.futureSet(output,val);
              stmtIt.set(futureSet);
              logger.trace("String_Node_Str" + futureSet);
            }
          }
 else           if (Types.isScalarValue(output)) {
            Arg val=state.findValue(output);
            if (val != null && val.isConstant()) {
              Instruction valueSet=ICInstructions.valueSet(output,val);
              stmtIt.set(valueSet);
              logger.trace("String_Node_Str" + valueSet);
            }
          }
        }
      }
      InitVariables.updateInitVars(logger,stmt,init,false);
    }
 else {
      assert(stmt.type() == StatementType.CONDITIONAL);
      replaceCongruentNonRec(stmt.conditional(),state,init);
      replaceValsRec(consts,stmt.conditional(),congruences,init);
    }
  }
  replaceCleanupCongruent(block,state,init);
  for (  Continuation cont : block.getContinuations()) {
    replaceCongruentNonRec(cont,state,init);
    replaceValsRec(consts,cont,congruences,init);
  }
}