let new_frame kf ~m_here ~m_pre ~m_post ropt =
    let may_cons acc lab x = match x with
      | None -> acc
      | Some x -> (lab,x)::acc
    in
    let states = may_cons []     Clabels.Post m_post in
    let states = may_cons states Clabels.Pre m_pre in
    let states = may_cons states Clabels.Here m_here in
    {
      kf = kf;
      states = states;
      result = ropt ;
      exit_status = None;
      ret_type = Some (Kernel_function.get_return_type kf);
    }