private void processFunctionJumpReferences(Program program, Address entry, TaskMonitor monitor)
			throws CancelledException {

		// since reference fixup will occur when flow override is done,
		// avoid concurrent modification during reference iterator use
		// by building list of jump references
		List<Reference> fnRefList = getJumpRefsToFunction(program, entry, monitor);
		if (fnRefList == null) {
			return;
		}

		FunctionManager funcMgr = program.getFunctionManager();

		for (Reference ref : fnRefList) {
			monitor.checkCancelled();
			Instruction instr = program.getListing().getInstructionAt(ref.getFromAddress());
			if (instr == null) {
				continue;
			}
			Reference checkRef = getSingleFlowReferenceFrom(instr);
			if (checkRef == null) {
				continue;
			}

			// if there is a function at this address, this is a thunk
			//    Handle differently
			Address refInstrAddr = instr.getMinAddress();

			if (funcMgr.getFunctionAt(refInstrAddr) != null) {
				continue;
			}

			// if this instruction is contained in the body of the function
			// then it is just an internal jump reference to the top of the
			// function
			Function functionContaining = funcMgr.getFunctionContaining(refInstrAddr);
			if (functionContaining != null && functionContaining.getEntryPoint().equals(entry)) {
				continue;
			}

			if (checkRef.getToAddress().equals(ref.getToAddress())) {
				if (instr.getFlowOverride() != FlowOverride.NONE) {
					continue;
				}
				SetFlowOverrideCmd cmd =
					new SetFlowOverrideCmd(refInstrAddr, FlowOverride.CALL_RETURN);
				cmd.applyTo(program);
			}
		}
	}
Constructor
@param set set of addresses over which destination functions will be
examined for Jump reference to those functions.
@param assumeContiguousFunctions if true it will be assumed that any unconditional
jump over another function will trigger a call-return override and the creation of
@param considerConditionalBranches if true conditional jumps can also be considered for jumping
to another function as a shared return.
a function at the destination.
Ghidra/Features/Base/src/main/java/ghidra/app/cmd/analysis/SharedReturnAnalysisCmd.java