private void repairDamagedLocations(TaskMonitor taskMonitor, AddressSet clearInstSet, AddressSet protectedLocations) {
		if (clearInstSet == null || clearInstSet.isEmpty()) {
			return;
		}
		AutoAnalysisManager analysisManager = AutoAnalysisManager.getAnalysisManager(program);

		AddressSetView protectedSet = analysisManager.getProtectedLocations();
		
		protectedSet = protectedSet.union(protectedLocations);

		// TODO: are there other protected locations,
		//       that should never be seeds for locations to be cleared?
		//       For example:
		//          - functions that were marked non-returning by the analyzer.
		//          - locations that are known function start patterns?

		// entries including data flow referenced from instructions will be repaired

		ClearFlowAndRepairCmd cmd =
			new ClearFlowAndRepairCmd(clearInstSet, protectedSet, true, false, true);
		cmd.applyTo(program, taskMonitor);
	}
repair any damaged locations

@param taskMonitor for cancellation
@param clearInstSet locations to clear and repair
@param protectedLocations - locations that should be protected from clearing
Ghidra/Features/Base/src/main/java/ghidra/app/plugin/core/analysis/FindNoReturnFunctionsAnalyzer.java