private static int followIndirection(LinkedList<CodeBlockReferenceImpl> blockRefQueue, CodeBlock destBlock, Reference destRef, TaskMonitor monitor) throws CancelledException {    	
		
		SimpleBlockModel model = (SimpleBlockModel)destBlock.getModel();
		Address addr = destRef.getFromAddress();
		Listing listing = model.getListing();
		Data data = listing.getDefinedDataContaining(addr);
		if (data == null)
			return 0;
			
    	int cnt = 0;
    	
// ?? Handle special cases - offset is 0 within array of pointers, or offset to pointer within array of structures
    	
    	int offset = (int)addr.subtract(data.getMinAddress());
    	Data primitive = data.getPrimitiveAt(offset);
    	if (primitive != null) {

			// Follow references to pointer - could have multiple references 			
			ReferenceIterator iter = primitive.getReferenceIteratorTo();
			while (iter.hasNext()) {
				Reference ref = iter.next();
				
				if (monitor.isCancelled())
					throw new CancelledException();
				
				RefType rt = ref.getReferenceType();			
				if (rt != RefType.INDIRECTION && rt != RefType.READ)
					continue;
				
				Address fromAddr = ref.getFromAddress();
				Instruction instr = listing.getInstructionAt(fromAddr);
								
				if (instr == null)
					continue;
				
				if (rt == RefType.READ && !instr.getFlowType().isComputed())
					continue;

				queueDestReference(blockRefQueue, destBlock, destRef.getToAddress(), fromAddr,
				            instr.getFlowType().isCall() ? RefType.COMPUTED_CALL : RefType.COMPUTED_JUMP, monitor);
				++cnt;
			}  			
    	}
    	return cnt;
    }
Process a data reference for possible indirect sources.  Update block reference queue 
with indirect block references.
@param blockRefQueue the CodeBlockReference queue, may be null
@param destBlock reference/destination block
@param destRef possible pointer reference to destBlock (is not verified)
@param indirectFlowType reference type to assign to indirect references discovered
@param monitor task monitor which allows user to cancel operation.
@return number of references found, 0 if memRef does not correspond to a pointer.
@throws CancelledException if the monitor cancels the operation.
Ghidra/Framework/SoftwareModeling/src/main/java/ghidra/program/model/block/SimpleSourceReferenceIterator.java