Program: 110868
Project: 110868
Buggy source:
private static void addTransitiveInfoProviders(RuleContext ruleContext,CppConfiguration cppConfiguration,CcCommon common,RuleConfiguredTargetBuilder builder,NestedSet<Artifact> filesToBuild,CcCompilationOutputs ccCompilationOutputs,CppCompilationContext cppCompilationContext,CcLinkingOutputs linkingOutputs,DwoArtifactsCollector dwoArtifacts,TransitiveLipoInfoProvider transitiveLipoInfo,boolean fake){
  List<Artifact> instrumentedObjectFiles=new ArrayList<>();
  instrumentedObjectFiles.addAll(ccCompilationOutputs.getObjectFiles(false));
  instrumentedObjectFiles.addAll(ccCompilationOutputs.getObjectFiles(true));
  InstrumentedFilesProvider instrumentedFilesProvider=common.getInstrumentedFilesProvider(instrumentedObjectFiles,!TargetUtils.isTestRule(ruleContext.getRule()) && !fake);
  NestedSet<Artifact> filesToCompile=ccCompilationOutputs.getFilesToCompile(cppConfiguration.isLipoContextCollector(),cppConfiguration.processHeadersInDependencies(),CppHelper.usePic(ruleContext,false));
  NestedSet<Artifact> artifactsToForce=collectHiddenTopLevelArtifacts(ruleContext);
  builder.setFilesToBuild(filesToBuild).add(CppCompilationContext.class,cppCompilationContext).add(TransitiveLipoInfoProvider.class,transitiveLipoInfo).add(CcExecutionDynamicLibrariesProvider.class,new CcExecutionDynamicLibrariesProvider(collectExecutionDynamicLibraryArtifacts(ruleContext,linkingOutputs.getExecutionDynamicLibraries()))).add(CcNativeLibraryProvider.class,new CcNativeLibraryProvider(collectTransitiveCcNativeLibraries(ruleContext,linkingOutputs.getDynamicLibraries()))).add(InstrumentedFilesProvider.class,instrumentedFilesProvider).add(CppDebugFileProvider.class,new CppDebugFileProvider(dwoArtifacts.getDwoArtifacts(),dwoArtifacts.getPicDwoArtifacts())).addOutputGroup(OutputGroupProvider.TEMP_FILES,getTemps(cppConfiguration,ccCompilationOutputs)).addOutputGroup(OutputGroupProvider.FILES_TO_COMPILE,filesToCompile).addOutputGroup(OutputGroupProvider.HIDDEN_TOP_LEVEL,artifactsToForce).addOutputGroup(OutputGroupProvider.COMPILATION_PREREQUISITES,CcCommon.collectCompilationPrerequisites(ruleContext,cppCompilationContext));
  CppHelper.maybeAddStaticLinkMarkerProvider(builder,ruleContext);
}

Fixed version (ground truth):
private static void addTransitiveInfoProviders(RuleContext ruleContext,CppConfiguration cppConfiguration,CcCommon common,RuleConfiguredTargetBuilder builder,NestedSet<Artifact> filesToBuild,CcCompilationOutputs ccCompilationOutputs,CppCompilationContext cppCompilationContext,CcLinkingOutputs linkingOutputs,DwoArtifactsCollector dwoArtifacts,TransitiveLipoInfoProvider transitiveLipoInfo,boolean fake){
  List<Artifact> instrumentedObjectFiles=new ArrayList<>();
  instrumentedObjectFiles.addAll(ccCompilationOutputs.getObjectFiles(false));
  instrumentedObjectFiles.addAll(ccCompilationOutputs.getObjectFiles(true));
  InstrumentedFilesProvider instrumentedFilesProvider=common.getInstrumentedFilesProvider(instrumentedObjectFiles,!TargetUtils.isTestRule(ruleContext.getRule()) && !fake);
  NestedSet<Artifact> headerTokens=CcLibraryHelper.collectHeaderTokens(ruleContext,ccCompilationOutputs);
  NestedSet<Artifact> filesToCompile=ccCompilationOutputs.getFilesToCompile(cppConfiguration.isLipoContextCollector(),cppConfiguration.processHeadersInDependencies(),CppHelper.usePic(ruleContext,false));
  builder.setFilesToBuild(filesToBuild).add(CppCompilationContext.class,cppCompilationContext).add(TransitiveLipoInfoProvider.class,transitiveLipoInfo).add(CcExecutionDynamicLibrariesProvider.class,new CcExecutionDynamicLibrariesProvider(collectExecutionDynamicLibraryArtifacts(ruleContext,linkingOutputs.getExecutionDynamicLibraries()))).add(CcNativeLibraryProvider.class,new CcNativeLibraryProvider(collectTransitiveCcNativeLibraries(ruleContext,linkingOutputs.getDynamicLibraries()))).add(InstrumentedFilesProvider.class,instrumentedFilesProvider).add(CppDebugFileProvider.class,new CppDebugFileProvider(dwoArtifacts.getDwoArtifacts(),dwoArtifacts.getPicDwoArtifacts())).addOutputGroup(OutputGroupProvider.TEMP_FILES,getTemps(cppConfiguration,ccCompilationOutputs)).addOutputGroup(OutputGroupProvider.FILES_TO_COMPILE,filesToCompile).addOutputGroup(OutputGroupProvider.HIDDEN_TOP_LEVEL,headerTokens).addOutputGroup(OutputGroupProvider.COMPILATION_PREREQUISITES,CcCommon.collectCompilationPrerequisites(ruleContext,cppCompilationContext));
  CppHelper.maybeAddStaticLinkMarkerProvider(builder,ruleContext);
}