private void followInstruction(Stack<CodeUnit> instructionStack, AddressSet flowAddressSet,
			Instruction currentInstr) {

		Address nextAddress = null;

		/*****************
		 * Follow Flows  *
		 *****************/
		Address[] flowAddresses = getFlowsFromInstruction(currentInstr);
		for (int index = 0; (flowAddresses != null) && (index < flowAddresses.length); index++) {
			nextAddress = flowAddresses[index];
			if (nextAddress != null && (restrictedAddressSpace == null ||
				restrictedAddressSpace == nextAddress.getAddressSpace())) {
				CodeUnit nextCodeUnit = program.getListing().getCodeUnitContaining(nextAddress);
				if (nextCodeUnit != null) {
					if (nextCodeUnit instanceof Data && includeData) {
						followData(instructionStack, flowAddressSet, (Data) nextCodeUnit,
							nextAddress);
					}
					else {
						instructionStack.push(nextCodeUnit);
					}
				}
			}
		}

		/***********************
		 * Follow Fallthrough  *
		 ***********************/
		// If we can fall through then get that instruction, add it to the
		// address set and see where it flows.
		nextAddress = currentInstr.getFallThrough();

		// Don't follow if not following into functions, and fall into a function.
		if (!followIntoFunction) {
			nextSymbolAddr = getNextSymbolAddress(nextAddress, nextSymbolAddr);
			if (nextSymbolAddr != null && nextSymbolAddr.equals(nextAddress)) {
				Symbol symbol = program.getSymbolTable().getPrimarySymbol(nextAddress);
				if (symbol.getSymbolType() == SymbolType.FUNCTION) {
					nextAddress = null;
				}
			}
		}

		if (nextAddress != null && (restrictedAddressSpace == null ||
			restrictedAddressSpace == nextAddress.getAddressSpace())) {
			Instruction nextInstruction = program.getListing().getInstructionAt(nextAddress);
			if (nextInstruction != null) {
				instructionStack.push(nextInstruction);
			}
		}

	}
followInstruction follows the program's instruction flow and adds addresses
to the address set for the flow from the current location.
The plugin's properties indicate which flow types should be followed for
instruction code units.

@param flowAddressSet the address set to add our addresses to.
@param currentInstr the Instruction object to flow from.
    Appropriate flows out of this code unit will be traversed.
Ghidra/Framework/SoftwareModeling/src/main/java/ghidra/program/model/block/FollowFlow.java