private int createData(Program program, Address address, DataType dataType, int size) {
		// defined data (that isn't an undefined) don't do anything
		Data data = program.getListing().getDataAt(address);
		if (data == null || !Undefined.isUndefined(data.getDataType())) {
			return 0;
		}

		// get a default undefined data type of the right size for the access
		DataType dt = Undefined.getUndefinedDataType(size);

		int maxLen = -1;
		if (createDataFromPointers && dataType != null) {
			DataType originalDT = dataType;

			// if typedef, get the base type
			if (dataType instanceof TypeDef typeDef) {
				dataType = typeDef.getBaseDataType();
			}

			if (dataType instanceof CharDataType) {
				// Use Terminated in case strings are referenced offcut
				maxLen = getRestrictedStringLen(program, address, TerminatedStringDataType.dataType,
					MAX_CHAR_STRING__LEN);
				if (maxLen > 0) {
					dt = TerminatedStringDataType.dataType;
				}
			}
			else if (dataType instanceof WideCharDataType) {
				maxLen = getRestrictedStringLen(program, address,
					TerminatedUnicodeDataType.dataType, MAX_UNICODE_STRING_LEN);
				if (maxLen > 0) {
					dt = TerminatedUnicodeDataType.dataType;
				}
			}
			else if (dataType instanceof Composite comp) {
				// create empty structures, they can get filled out later
				// if they don't fit later because they grow, then there will be an error at the location
				dt = originalDT; // original might have been a typedef, use original
			}
			else if (dataType instanceof VoidDataType) {
				// ptr to void should be ignored
				return 0;
			}
			else if (dataType instanceof AbstractFloatDataType) {
				dt = dataType;
			}
			else {
				// don't do any other types other than above for now
				return 0;
			}
		}
		else if (size < 1 || size > 8) {
			return 0;
		}

		try {
			// create data at the location so that we record the access size
			//   the data is undefined, and SHOULD be overwritten if something
			//   else knows better about the location.
			if (maxLen > 0) {
				data = DataUtilities.createData(program, address, dt, maxLen,
					ClearDataMode.CLEAR_ALL_UNDEFINED_CONFLICT_DATA);
			}
			else {
				data = DataUtilities.createData(program, address, dt, -1,
					ClearDataMode.CLEAR_ALL_UNDEFINED_CONFLICT_DATA);
			}
			return data.getLength();
		}
		catch (CodeUnitInsertionException e) {
			// couldn't create data
		}

		return 0;
	}
Create Data at an address in the program

@param program the program
@param address location to create data
@param dataType dataType if known
@param size size of the data type (from a read/write)
@return size of the data item created, or 0 if none created
Ghidra/Features/Base/src/main/java/ghidra/app/plugin/core/analysis/ConstantPropagationContextEvaluator.java