function mergeExtraSegments(context, segments) {
  let currentSegments = segments;

  while (currentSegments.length > context.count) {
    const merged = [];

    for (
      let i = 0, length = (currentSegments.length / 2) | 0;
      i < length;
      ++i
    ) {
      merged.push(
        CodePathSegment.newNext(context.idGenerator.next(), [
          currentSegments[i],
          currentSegments[i + length],
        ]),
      );
    }
    currentSegments = merged;
  }
  return currentSegments;
}
`segments` becomes doubly in a `finally` block. Then if a code path exits by a
control statement (such as `break`, `continue`) from the `finally` block, the
destination's segments may be half of the source segments. In that case, this
merges segments.
@param {ForkContext} context An instance.
@param {CodePathSegment[]} segments Segments to merge.
@returns {CodePathSegment[]} The merged segments.