Program: 27887
Project: 27887
Buggy source:
/** 
 * Set no side effect property at pure-function call sites.
 */
private void markPureFunctionCalls(){
  for (  Node callNode : allFunctionCalls) {
    Node name=callNode.getFirstChild();
    Collection<Definition> defs=getCallableDefinitions(definitionProvider,name);
    Node.SideEffectFlags flags=new Node.SideEffectFlags();
    if (defs == null) {
      flags.setMutatesGlobalState();
      flags.setThrows();
      flags.setReturnsTainted();
    }
 else {
      flags.clearAllFlags();
      for (      Definition def : defs) {
        FunctionInformation functionInfo=functionSideEffectMap.get(def.getRValue());
        Preconditions.checkNotNull(functionInfo);
        if (functionInfo.mutatesGlobalState()) {
          flags.setMutatesGlobalState();
        }
        if (functionInfo.functionThrows) {
          flags.setThrows();
        }
        if (!callNode.isNew()) {
          if (functionInfo.taintsThis) {
            flags.setMutatesThis();
          }
        }
        if (functionInfo.taintsReturn) {
          flags.setReturnsTainted();
        }
        if (flags.areAllFlagsSet()) {
          break;
        }
      }
    }
    if (callNode.isCall()) {
      Preconditions.checkState(compiler != null);
      if (!NodeUtil.functionCallHasSideEffects(callNode,compiler)) {
        flags.clearSideEffectFlags();
      }
    }
 else     if (callNode.isNew()) {
      if (!NodeUtil.constructorCallHasSideEffects(callNode)) {
        flags.clearSideEffectFlags();
      }
    }
    callNode.setSideEffectFlags(flags.valueOf());
  }
}

Fixed version (ground truth):
/** 
 * Set no side effect property at pure-function call sites.
 */
private void markPureFunctionCalls(){
  for (  Node callNode : allFunctionCalls) {
    Node name=callNode.getFirstChild();
    Collection<Definition> defs=getCallableDefinitions(definitionProvider,name);
    Node.SideEffectFlags flags=new Node.SideEffectFlags();
    if (defs == null) {
      flags.setMutatesGlobalState();
      flags.setThrows();
      flags.setReturnsTainted();
    }
 else {
      flags.clearAllFlags();
      for (      Definition def : defs) {
        FunctionInformation functionInfo=functionSideEffectMap.get(def.getRValue());
        Preconditions.checkNotNull(functionInfo);
        if (functionInfo.mutatesGlobalState()) {
          flags.setMutatesGlobalState();
        }
        if (functionInfo.functionThrows) {
          flags.setThrows();
        }
        if (!callNode.isNew()) {
          if (functionInfo.taintsThis) {
            if (isCallOrApply(callNode)) {
              flags.setMutatesArguments();
            }
 else {
              flags.setMutatesThis();
            }
          }
        }
        if (functionInfo.taintsReturn) {
          flags.setReturnsTainted();
        }
        if (flags.areAllFlagsSet()) {
          break;
        }
      }
    }
    if (callNode.isCall()) {
      Preconditions.checkState(compiler != null);
      if (!NodeUtil.functionCallHasSideEffects(callNode,compiler)) {
        flags.clearSideEffectFlags();
      }
    }
 else     if (callNode.isNew()) {
      if (!NodeUtil.constructorCallHasSideEffects(callNode)) {
        flags.clearSideEffectFlags();
      }
    }
    callNode.setSideEffectFlags(flags.valueOf());
  }
}