let next_edge cfg n =
  let edges = match node_type n with
    | VblkIn _ | Vswitch _ | Vtest _ | Vloop _ ->
        let edges = CFG.succ_e cfg.graph n in
          List.filter (fun e -> (edge_type e) = Enext) edges
    | Vcall _ ->
        let en, _ee = get_call_out_edges cfg n in [en]
    | Vstmt _ ->
        let edges = match CFG.succ_e cfg.graph n with
          | (([] | _::[]) as edges) -> edges
          | edges -> (* this case may happen in case of a loop
                        which is not really a loop : it is then a Vstmt,
                        and the Enext is not the succ_e. *)

              List.filter (fun e -> (edge_type e) = Enext) edges
        in edges
    | _ ->
        debug "[next_edge] not found for %a@." pp_node n;
        raise Not_found (* No Enext information on this node *)
  in
    match edges with
      | [] -> (* can append when nodes have been removed *) raise Not_found
      | [e] -> e
      | _ -> Wp_parameters.fatal "several (%d) Enext edges to node %a" 
               (List.length edges) pp_node n