public static AddressSpace getPointerAddressSpace(TypeDef pointerTypeDef,
			AddressFactory addrFactory) {
		if (!pointerTypeDef.isPointer()) {
			return null;
		}
		Settings settings = pointerTypeDef.getDefaultSettings();
		String spaceName =
			AddressSpaceSettingsDefinition.DEF.getValue(settings);
		if (spaceName == null) {
			return null;
		}
		AddressSpace addressSpace = addrFactory.getAddressSpace(spaceName);
		if (addressSpace instanceof SegmentedAddressSpace) {
			// Other settings do not apply when SegmentedAddressSpace is used
			// see PointerDataType.getAddressValue(MemBuffer, int, Settings)
			return addressSpace;
		}
		// Address space setting ignored if Pointer Type has been specified
		PointerType choice = PointerTypeSettingsDefinition.DEF.getType(settings);
		return choice == PointerType.DEFAULT ? addressSpace : null;
	}
Determine the referenced address space for specified pointerTypeDef based upon
its default settings.
@param pointerTypeDef Pointer TypeDef
@param addrFactory target address factory
@return referenced address space or null if not specified or address space
lookup fails.
Ghidra/Framework/SoftwareModeling/src/main/java/ghidra/program/database/data/PointerTypedefInspector.java