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
        (may_cons
           (may_cons [] Clabels.Post m_post)
           Clabels.Pre
           m_pre)
        Clabels.Here
        m_here
      in
      {
        kf = kf;
        states = states;
        result = ropt ;
        exit_status = None;
        return = Some(Kernel_function.get_return_type kf);
      }