let get_switch_edges cfg v =
  match node_type v with
  | Vswitch _ ->
      begin
      let get_case (cl, dl) e = match (edge_type e) with
        | Ecase [] -> cl, e::dl
        | Ecase c -> (c, e)::cl, dl
        | _ ->  Wp_parameters.fatal ("[cfg] switch node with invalid edges")
      in match List.fold_left get_case ([],[]) (succ_e cfg v) with
        | cl, [d] -> cl, d
        | _ ->
            Wp_parameters.fatal ("[cfg] switch node with several 'default' ?")
      end
  | _ -> raise (Invalid_argument "[cfg:get_switch_edges] not a switch")