@Override
	public Variable getObject() {

		try {
			var.getName();
			return var;
		}
		catch (Exception e) {
		}

		if (storageAddr == null) {
			return null;
		}

		Listing listing = program.getListing();

		Function function = listing.getFunctionAt(functionAddr);
		if (function == null) {
			return null;
		}

		if (!locationAddr.equals(functionAddr)) {
			// ensure that inferred reference is valid
			if (listing.getFunctionAt(locationAddr) != null) {
				return null;
			}
			CodeUnit cu = listing.getCodeUnitAt(locationAddr);
			if (!(cu instanceof Data)) {
				return null;
			}
			Data data = (Data) cu;
			if (!(data.getDataType() instanceof Pointer)) {
				return null;
			}
			Reference ref = data.getPrimaryReference(0);
			if (ref == null || !ref.getToAddress().equals(functionAddr)) {
				return null;
			}
		}

		if (ordinal >= 0) {
			return function.getParameter(ordinal);
		}

		Variable[] vars = function.getLocalVariables();
		for (Variable var2 : vars) {
			if (firstUseOffset != var2.getFirstUseOffset()) {
				continue;
			}
			if (storageAddr.equals(var2.getMinAddress())) {
				var = var2;
				return var;
			}
		}
		return null;
	}
Constructs a proxy for a variable.
@param model listing model
@param program the program containing the variable.
@param locationAddr the listing address at which the function exists or was inferred via reference
@param fun the function containing the variable.
@param var the variable to proxy.
Ghidra/Features/Base/src/main/java/ghidra/app/util/viewer/proxy/VariableProxy.java