Commits

Anonymous committed 878c02d

'old_vis' bugfix

Comments (0)

Files changed (1)

                 else inner ~acc:[h :: acc] ~prevs:t
             ]
       ]
+(*
+      (* for debugging: *)
+      List.rev vis
+*)
     ;
 
     value visited_labels_rev = ref []
     ;
 
     value force ll =
+      let old_vis = visited_labels_rev.val in
       let () = visited_labels_rev.val :=
         [ll.l :: visited_labels_rev.val] in
       try
         let r = Lazy.force ll.v in
-        ( visited_labels_rev.val := []
+        ( visited_labels_rev.val := old_vis
         ; r
         )
       with
       [ CamlinternalLazy.Undefined ->
           let c = visited_labels_rev.val in
-          ( visited_labels_rev.val := []
+          ( visited_labels_rev.val := old_vis
           ; raise (Cycle (get_cycle ~vis:c))
           )
+      | e ->
+          ( visited_labels_rev.val := old_vis
+          ; raise e
+          )
       ]
     ;