Program: 133263
Project: 133263
Buggy source:
/** 
 * Find all the directly assigned constants in the block
 * @param logger
 * @param block
 * @param knownConstants
 * @param removeDefs if true, remove the set instructions as we go
 */
private static void findBlockConstants(Logger logger,Block block,Map<String,Oparg> knownConstants,boolean removeLocalConsts,boolean ignoreLocalValConstants){
  Set<String> removalCandidates=null;
  if (removeLocalConsts) {
    removalCandidates=new HashSet<String>();
    for (    Variable v : block.getVariables()) {
      if (v.getStorage() != VariableStorage.ALIAS) {
        removalCandidates.add(v.getName());
      }
    }
  }
  ListIterator<Instruction> it=block.instructionIterator();
  while (it.hasNext()) {
    Instruction inst=it.next();
    if (inst.getInputs().size() == 1) {
      Oparg input=inst.getInput(0);
      if (input.isConstant() && (inst.op == Opcode.STORE_INT || inst.op == Opcode.STORE_BOOL || inst.op == Opcode.STORE_FLOAT || inst.op == Opcode.STORE_STRING || (!ignoreLocalValConstants && inst.op == Opcode.LOCAL_OP && LocalBuiltin.isValueCopy(inst)))) {
        Oparg output=inst.getOutput(0);
        String varName=output.getVar().getName();
        if ((!removeLocalConsts) || removalCandidates.contains(varName)) {
          logger.debug("String_Node_Str" + varName);
          knownConstants.put(varName,input);
          if (removeLocalConsts && !inst.writesAliasVar()) {
            logger.trace("String_Node_Str" + inst.toString());
            it.remove();
          }
        }
      }
    }
  }
  if (removeLocalConsts) {
    block.removeVarDeclarations(knownConstants.keySet());
  }
}

Fixed version (ground truth):
/** 
 * Find all the directly assigned constants in the block
 * @param logger
 * @param block
 * @param knownConstants
 * @param removeDefs if true, remove the set instructions as we go
 */
private static void findBlockConstants(Logger logger,Block block,Map<String,Oparg> knownConstants,boolean removeLocalConsts,boolean ignoreLocalValConstants){
  Set<String> removalCandidates=null;
  if (removeLocalConsts) {
    removalCandidates=new HashSet<String>();
    for (    Variable v : block.getVariables()) {
      if (v.getStorage() != VariableStorage.ALIAS) {
        removalCandidates.add(v.getName());
      }
    }
  }
  ListIterator<Instruction> it=block.instructionIterator();
  while (it.hasNext()) {
    Instruction inst=it.next();
    if (inst.getInputs().size() == 1) {
      Oparg input=inst.getInput(0);
      if (input.isConstant() && (inst.op == Opcode.STORE_INT || inst.op == Opcode.STORE_BOOL || inst.op == Opcode.STORE_FLOAT || inst.op == Opcode.STORE_STRING || (!ignoreLocalValConstants && inst.op == Opcode.LOCAL_OP && LocalBuiltin.isValueCopy(inst)))) {
        Oparg output=inst.getOutput(0);
        String varName=output.getVar().getName();
        if ((!removeLocalConsts) || removalCandidates.contains(varName)) {
          logger.debug("String_Node_Str" + varName);
          knownConstants.put(varName,input);
          if (removeLocalConsts && !inst.hasSideEffects()) {
            logger.trace("String_Node_Str" + inst.toString());
            it.remove();
          }
        }
      }
    }
  }
  if (removeLocalConsts) {
    block.removeVarDeclarations(knownConstants.keySet());
  }
}