function leaveFromCurrentSegment(analyzer, node) {
  const state = CodePath.getState(analyzer.codePath);
  const currentSegments = state.currentSegments;

  for (let i = 0; i < currentSegments.length; ++i) {
    const currentSegment = currentSegments[i];
    if (currentSegment.reachable) {
      analyzer.emitter.emit('onCodePathSegmentEnd', currentSegment, node);
    }
  }

  state.currentSegments = [];
}
Updates the current segment with empty.
This is called at the last of functions or the program.
@param {CodePathAnalyzer} analyzer The instance.
@param {ASTNode} node The current AST node.
@returns {void}