private boolean checkPseudoBody(Address entry, AddressSet body, AddressSet starts,
			boolean allowExistingInstructions, boolean didCallValidSubroutine) {

		if (program == null) {
			return true;
		}

		// check that body does not wander into non-executable memory
		AddressSetView execSet = memory.getExecuteSet();
		if (respectExecuteFlag && !execSet.isEmpty() && !execSet.contains(body)) {
			return false;
		}

		// check that the body traversed to a terminal does not
		//   have any anomolies in it.
		//   Existing Instructions/Data
		if (program.getListing().getDefinedData(body, true).hasNext()) {
			return false;
		}

		boolean canHaveOffcutEntry = hasLowBitCodeModeInAddrValues(program);
		AddressSet strictlyBody = body.subtract(starts);
		if (canHaveOffcutEntry) {
			strictlyBody.deleteRange(entry, entry.add(1));
		}
		AddressIterator addrIter =
			program.getReferenceManager().getReferenceDestinationIterator(strictlyBody, true);
		if (addrIter.hasNext()) {
			return false;  // don't allow offcut references
		}

		// if existing instructions are allowed,
		//    don't worry about multiple entry points either.
		if (allowExistingInstructions) {
			return true;
		}

		if (program.getListing().getInstructions(body, true).hasNext()) {
			return false;
		}

		// don't allow one instruction
		if (!didCallValidSubroutine && starts.getMinAddress().equals(starts.getMaxAddress())) {
			return false;
		}

		// if there are any references internally, that isn't the entry point
		//  it is a bady subroutine.
		AddressIterator iter;
		iter = program.getReferenceManager().getReferenceDestinationIterator(body, true);
		while (iter.hasNext()) {
			Address toAddr = iter.next();
			if (!toAddr.equals(entry)) {
				if (entry.add(1).equals(toAddr) && hasLowBitCodeModeInAddrValues(program)) {
					continue;
				}
				return false;
			}
		}
		return true;
	}
Make sure the instruction really has a return in it.

@param instr instruction to check
Ghidra/Framework/SoftwareModeling/src/main/java/ghidra/app/util/PseudoDisassembler.java