private Address readPointer(MemBuffer buffer, int bufferOffset, AddressSpace addrSpace,
			boolean updateReference) {
		byte[] bytes = new byte[pointerSize];
		buffer.getBytes(bytes, bufferOffset);
		long offset = Utils.bytesToLong(bytes, pointerSize, buffer.isBigEndian()) *
			addrSpace.getAddressableUnitSize();
		Address addr = addrSpace.getAddress(offset);
		if (updateReference) {
			ReferenceManager refMgr = program.getReferenceManager();
			Address fromAddr = buffer.getAddress().add(bufferOffset);
			Reference ref = refMgr.getPrimaryReferenceFrom(fromAddr, 0);
			if (ref != null && !ref.getToAddress().equals(addr)) {
				refMgr.delete(ref);
				ref = null;
			}
			if (ref == null) {
				refMgr.addMemoryReference(fromAddr, addr, RefType.DATA, SourceType.USER_DEFINED, 0);
			}
		}
		return addr;
	}
Force an existing reference to refer to the code space.  Pointers
created in the data space refer to the data space by default, this method
is used to change these pointers in the data space to refer to 
code.
@param addr location with data space which contains code reference
Ghidra/Features/Base/src/main/java/ghidra/test/processors/support/PCodeTestAbstractControlBlock.java