@Override
	public List<CodeUnit> calculateExtent(Function func) {
		if (func == null) {
			return List.of();
		}
		final AddressSetView body = func.getBody();
		if (body.isEmpty()) {
			return List.of();
		}
		ArrayList<CodeUnit> units = new ArrayList<CodeUnit>();

		final Program program = func.getProgram();
		final Listing listing = program.getListing();

		InstructionIterator codeUnitIterator = listing.getInstructions(body, true);
		for (Instruction codeUnit : codeUnitIterator) {
			units.add(codeUnit);
		}

		return units;
	}
Calculates the function extent by the function body; i.e. what's saved
in the database as the body, which could be totally wrong (but then
again, so could we, if we try to determine it ourselves).
Ghidra/Features/FunctionID/src/main/java/ghidra/feature/fid/hash/FunctionBodyFunctionExtentGenerator.java