summaryrefslogtreecommitdiff
path: root/src/jib/jib_ssa.ml
diff options
context:
space:
mode:
Diffstat (limited to 'src/jib/jib_ssa.ml')
-rw-r--r--src/jib/jib_ssa.ml4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/jib/jib_ssa.ml b/src/jib/jib_ssa.ml
index 1e008362..ad2302de 100644
--- a/src/jib/jib_ssa.ml
+++ b/src/jib/jib_ssa.ml
@@ -124,6 +124,8 @@ let reachable roots graph =
in
IntSet.iter reachable' roots; !visited
+exception Not_a_DAG of int;;
+
let topsort graph =
let marked = ref IntSet.empty in
let temp_marked = ref IntSet.empty in
@@ -131,7 +133,7 @@ let topsort graph =
let rec visit node =
if IntSet.mem node !temp_marked then
- failwith "Not a DAG"
+ raise (Not_a_DAG node)
else if IntSet.mem node !marked then
()
else