ControlFlow () { // make all non patched goto instructions jump to the end of control flow for (IntList offsets : offsetsAddElementStart.values()) { patchInstructionOffsets(offsets, myCurrentFlow.getEndOffset(myCodeFragment)); } for (IntList offsets : offsetsAddElementEnd.values()) { patchInstructionOffsets(offsets, myCurrentFlow.getEndOffset(myCodeFragment)); } ControlFlow result = myCurrentFlow.immutableCopy(); // register all sub ranges for (SubRangeInfo info : mySubRanges) { ProgressManager.checkCanceled(); myControlFlowFactory.registerSubRange(info.myElement, new ControlFlowSubRange(result, info.myStart, info.myEnd), myOptions, myPolicy); } return result; }