Program: 132857
Project: 132857
Buggy source:
private void findCongruencesRec(Program program,Function f,Block block,ExecContext execCx,Congruences state,Map<Block,Congruences> result) throws OptUnsafeError {
  result.put(block,state);
  for (  Var v : block.getVariables()) {
    if (v.mapping() != null && Types.isFile(v.type())) {
      ValLoc filenameVal=ValLoc.makeFilename(v.mapping().asArg(),v);
      state.update(program.constants(),f.getName(),filenameVal,0);
    }
  }
  ListIterator<Statement> stmts=block.statementIterator();
  while (stmts.hasNext()) {
    int stmtIndex=stmts.nextIndex();
    Statement stmt=stmts.next();
    if (stmt.type() == StatementType.INSTRUCTION) {
      Instruction inst=stmt.instruction();
      if (logger.isTraceEnabled() && inst.op != Opcode.COMMENT) {
        state.printTraceInfo(logger,program.constants());
        logger.trace("String_Node_Str");
        logger.trace("String_Node_Str" + inst);
      }
      if (switchToImmediate(logger,f,execCx,block,state,inst,stmts,stmtIndex)) {
        continue;
      }
      findCongruencesInst(program,f,execCx,block,stmts,inst,stmtIndex,state);
    }
 else {
      assert(stmt.type() == StatementType.CONDITIONAL);
      UnifiedValues unified=findCongruencesContRec(program,f,execCx,stmt.conditional(),stmtIndex,state,result);
      state.addUnifiedValues(program.constants(),f.getName(),stmtIndex,unified);
    }
  }
  for (  Continuation cont : block.getContinuations()) {
    findCongruencesContRec(program,f,execCx,cont,stmts.previousIndex(),state,result);
  }
  validateState(program.constants(),state);
}

Fixed version (ground truth):
private void findCongruencesRec(Program program,Function f,Block block,ExecContext execCx,Congruences state,Map<Block,Congruences> result) throws OptUnsafeError {
  result.put(block,state);
  for (  Var v : block.getVariables()) {
    if (v.mapping() != null && Types.isFile(v.type())) {
      ValLoc filenameVal=ValLoc.makeFilename(v.mapping().asArg(),v);
      state.update(program.constants(),f.getName(),filenameVal,0);
    }
  }
  ListIterator<Statement> stmts=block.statementIterator();
  while (stmts.hasNext()) {
    int stmtIndex=stmts.nextIndex();
    Statement stmt=stmts.next();
    if (stmt.type() == StatementType.INSTRUCTION) {
      Instruction inst=stmt.instruction();
      if (logger.isTraceEnabled() && inst.op != Opcode.COMMENT) {
        state.printTraceInfo(logger,program.constants());
        logger.trace("String_Node_Str");
        logger.trace("String_Node_Str" + inst);
      }
      if (switchToImmediate(logger,f,execCx,block,state,inst,stmts,stmtIndex)) {
        continue;
      }
      findCongruencesInst(program,f,execCx,block,stmts,inst,stmtIndex,state);
    }
 else {
      assert(stmt.type() == StatementType.CONDITIONAL);
      UnifiedValues unified=findCongruencesContRec(program,f,execCx,stmt.conditional(),stmtIndex,state,result);
      state.addUnifiedValues(program.constants(),f.getName(),stmtIndex,unified);
    }
  }
  int stmtCount=block.getStatements().size();
  for (  Continuation cont : block.getContinuations()) {
    findCongruencesContRec(program,f,execCx,cont,stmtCount,state,result);
  }
  validateState(program.constants(),state);
}