private AddressSet checkExecBlocks(Program program, AddressSetView set) {
		// check if there is a block marked unexec

		AddressSet execSet = new AddressSet();
		MemoryBlock blocks[] = program.getMemory().getBlocks();
		for (int i = 0; i < blocks.length; i++) {
			if (blocks[i].isExecute()) {
				execSet.addRange(blocks[i].getStart(), blocks[i].getEnd());
			}
		}

		if (execSet.isEmpty()) {
			return new AddressSet(set);
		}
		if (set.isEmpty()) {
			return execSet;
		}
		return set.intersect(execSet);
	}
Check if there are blocks marked executable.
  If there are exec blocks, remove all un-exec blocks from the set.
@param program program
@param set addresses to be checked

@return set of address that are executable
Ghidra/Features/Base/src/main/java/ghidra/app/plugin/prototype/analysis/ArmAggressiveInstructionFinderAnalyzer.java