private void processEquateReference(Map<String, Object> result, boolean overwrite) {
		try {
			Address addr = getLocation(result);
			if (addr == null) {
				throw new AddressFormatException("Incompatible Equate Reference Address");
			}

			if (listing.isUndefined(addr, addr)) {
				log.appendMsg("BAD EQUATE REFERENCE: defined code unit not found at " + addr);
				return;
			}

			CodeUnit cu = listing.getCodeUnitContaining(addr);
			if (cu == null) {
				log.appendMsg("No codeunit at " + addr);
				return;
			}

			String equateName = (String) result.get("name");

			int opIndex = CodeUnit.MNEMONIC;

			List<Scalar> instrScalars = new LinkedList<Scalar>();
			if (result.get("OpIndex") != null) {
				opIndex = (int) (double) result.get("opIndex");
				if (opIndex != CodeUnit.MNEMONIC) {
					Scalar tempScalar = cu.getScalar(opIndex);
					if (tempScalar != null) {
						instrScalars.add(tempScalar);
					} else if (cu instanceof Instruction) {
						Instruction instr = (Instruction) cu;
						Object[] opObjects = instr.getOpObjects(opIndex);
						for (int i = 0; i < opObjects.length; i++) {
							if (opObjects[i] instanceof Scalar) {
								instrScalars.add((Scalar) opObjects[i]);
							}
						}

						if (instrScalars.size() == 0) {
							log.appendMsg("BAD EQUATE REFERENCE: operand " + "[" + opIndex + "] at address " + "["
									+ addr + "] is not a scalar.");
							return;
						}
					}
				}
			}

			long value = 0;
			if (result.get("value") != null) {
				value = (long) result.get("value");
				Scalar matchingScalar = null;
				Iterator<Scalar> itr = instrScalars.iterator();
				while (matchingScalar == null && itr.hasNext()) {
					matchingScalar = itr.next();
					if (matchingScalar.getSignedValue() != value) {
						matchingScalar = null;
					}
				}

				if (matchingScalar == null) {
					log.appendMsg("BAD EQUATE REFERENCE: equate [" + equateName + "] value [0x"
							+ Long.toHexString(value) + "]" + " does not match scalar on operand [" + opIndex
							+ "] at address [" + addr + "]");
					return;
				}
			} else if (instrScalars.size() > 0) {
				// use scalar value as default - seems like a bad idea
				Msg.warn(this, "NO VALUE SPECIFIED");
				value = instrScalars.get(0).getSignedValue();
			} else {
				log.appendMsg("BAD EQUATE REFERENCE: either the VALUE or OPERAND_INDEX must be specified");
				return;
			}

			Equate equate = equateTable.getEquate(equateName);
			if (equate != null) {
				if (value != equate.getValue()) {
					log.appendMsg("BAD EQUATE REFERENCE: equate [" + equateName + "] value [0x"
							+ Long.toHexString(value) + "] conflicts with existing equate value [0x"
							+ Long.toHexString(equate.getValue()) + "].");
					return;
				}
			} else {
				try {
					equate = equateTable.createEquate(equateName, value);
				} catch (DuplicateNameException e) {
					throw new AssertException("Got duplicate name while creating equate " + equateName);
				} catch (InvalidInputException e) {
					log.appendMsg("Invalid name for equate " + equateName);
					return;
				}
			}

			Equate existingEquate = equateTable.getEquate(addr, opIndex, equate.getValue());
			if (existingEquate != null && overwrite) {
				existingEquate.removeReference(addr, opIndex);
			}
			equate.addReference(addr, opIndex);
		} catch (Exception e) {
			log.appendException(e);
		}
	}
@param result
@param language
@param overwrite
Ghidra/Features/Sarif/src/main/java/sarif/managers/MarkupSarifMgr.java