private boolean fixUpPackedStructureComponent(FixUpInfo info, Structure struct, DataType dt) {
		int ordinal = info.index;

		DataTypeComponent dtc = null;
		if (ordinal >= 0 || ordinal < struct.getNumComponents()) {
			dtc = struct.getComponent(ordinal);
		}

		if (dtc == null) {
			throw new AssertException("Expected bad datatype placeholder");
		}

		long lastChangeTime = struct.getLastChangeTime(); // Don't let the time change.
		try {
			if (dtc.isBitFieldComponent()) {
				if (info.bitOffset < 0) {
					throw new AssertException("Expected bitfield fixup location");
				}
				if (dt == null || dt.isDeleted()) {
					// bitfield will retain use of the primitive base datatype
					String comment =
						buildDataTypeFailureComment(info.componentDataType, null, dtc.getComment());
					dtc.setComment(comment);
					return false;
				}
				if (BitFieldDataType.isValidBaseDataType(dt)) {
					// replace bitfield base datatype - silent if updated type is not a valid base type
					BitFieldDataType bfDt = (BitFieldDataType) dtc.getDataType();
					struct.delete(ordinal);
					try {
						struct.insertBitField(ordinal, bfDt.getLength(), bfDt.getBitOffset(), dt,
							bfDt.getDeclaredBitSize(), dtc.getFieldName(), dtc.getComment());
						return true;
					}
					catch (InvalidDataTypeException e) {
						// Try again with primitive base type
						DataType primitiveBaseDt = bfDt.getPrimitiveBaseDataType();
						String comment = buildDataTypeFailureComment(info.componentDataType,
							e.getMessage(), dtc.getComment());
						try {
							struct.insertBitField(ordinal, bfDt.getLength(), bfDt.getBitOffset(),
								primitiveBaseDt, bfDt.getDeclaredBitSize(), dtc.getFieldName(),
								comment);
							return true;
						}
						catch (InvalidDataTypeException exc) {
							throw new RuntimeException(exc); // unexpected
						}
					}
				}
			}
			else {
				if (info.bitOffset >= 0) {
					throw new AssertException("Unexpected bitfield fixup location");
				}
				if (dtc.getDataType() != BadDataType.dataType) {
					throw new AssertException("Expected bad datatype placeholder");
				}
				if (dt == null || dt.isDeleted()) {
					String comment =
						buildDataTypeFailureComment(info.componentDataType, null, dtc.getComment());
					dtc.setComment(comment);
					return false;
				}

				// handle non-bitfield component fixup
				int length = dt.getLength();
				if (length <= 0) {
					length = dtc.getLength();
				}
				try {
					struct.replace(ordinal, dt, length, dtc.getFieldName(), dtc.getComment());
					return true;
				}
				catch (IllegalArgumentException e) {
					displayError(struct, e);
					String comment = buildDataTypeFailureComment(info.componentDataType,
						e.getMessage(), dtc.getComment());
					dtc.setComment(comment);
				}
			}
		}
		finally {
			struct.setLastChangeTime(lastChangeTime); // Reset the last change time to the merged data type's.
		}
		return false;
	}
Process fixup for packed structure component
@param info fixup info
@param struct result structure
@param dt component datatype (may be null if type failed to be resolved)
@return false if component not found, else true
Ghidra/Features/Base/src/main/java/ghidra/app/merge/datatypes/DataTypeMergeManager.java