private Address validateAddressSpace(Address address) throws ExpressionException {
		if (preferredSpace == null) {
			return address;
		}
		AddressSpace space = address.getAddressSpace();
		if (space.equals(preferredSpace)) {
			return address;
		}
		if (isOverlayRelated(space, preferredSpace)) {
			return preferredSpace.getAddress(address.getOffset());
		}
		throw new ExpressionException("Selected address space is not compatible with expression!");
	}
Sets the {@link AddressSpace} to be used to convert long values into addresses. 
@param space the address space to convert long values into addresses
Ghidra/Framework/SoftwareModeling/src/main/java/ghidra/program/util/AddressEvaluator.java