private Variable getVariableContaining(int offset, List<Variable> sortedVariables) {
		Object key = Integer.valueOf(offset);
		int index = Collections.binarySearch(sortedVariables, key, StackVariableComparator.get());
		if (index >= 0) {
			return sortedVariables.get(index);
		}
		index = -index - 1;
		index = index - 1;
		if (index < 0) {
			return null;
		}
		Variable var = sortedVariables.get(index);
		int stackOffset = var.getStackOffset();
		if ((stackOffset + var.getLength()) > offset) {
			if (var.getDataType().isDeleted()) {
				sortedVariables.remove(index);
			}
			else {
				return var;
			}
		}
		return null;
	}
Look at the result register to try and figure out stack access size.
@param symEval 

@param instr instruction being analyzed
@param opIndex operand that has a stack reference.

@return size of value referenced on the stack
Ghidra/Features/Base/src/main/java/ghidra/app/cmd/function/NewFunctionStackAnalysisCmd.java