private void aboutToProcess(int address, int reg) {
      boolean first = (endIndices == null);

      if ((address == lastAddress) && !first) {
        return;
      }

      if (address < lastAddress) {
        throw new RuntimeException("shouldn't happen");
      }

      if (first || (reg >= endIndices.length)) {
        /*
         * This is the first allocation of the state set and
         * index array, or we need to grow. (The latter doesn't
         * happen much; in fact, we have only ever observed
         * it happening in test cases, never in "real" code.)
         */
        int newSz = reg + 1;
        RegisterSpecSet newRegs = new RegisterSpecSet(newSz);
        int[] newEnds = new int[newSz];
        Arrays.fill(newEnds, -1);

        if (!first) {
          newRegs.putAll(regs);
          System.arraycopy(endIndices, 0, newEnds, 0, endIndices.length);
        }

        regs = newRegs;
        endIndices = newEnds;
      }
    }
Checks the address and other vitals as a prerequisite to further processing.

@param address {@code >= 0;} address about to be processed
@param reg {@code >= 0;} register number about to be processed
android/android_framework/dex-maker/src/main/java/com/android/dx/dex/code/LocalList.java