summaryrefslogtreecommitdiff
path: root/src/interpreter.ml
diff options
context:
space:
mode:
authorJon French2019-03-13 17:09:50 +0000
committerJon French2019-03-13 17:09:50 +0000
commitfd13ec718014c58fbb3fede23f6e6369d9e15c55 (patch)
treeeb5d3d86482a2b41bb72684f7d8a6966fc2f00f7 /src/interpreter.ml
parent5151a1e4f0c85da075012be116461cbf7b463c1d (diff)
Interpreter: error handling when calling primops
Diffstat (limited to 'src/interpreter.ml')
-rw-r--r--src/interpreter.ml6
1 files changed, 5 insertions, 1 deletions
diff --git a/src/interpreter.ml b/src/interpreter.ml
index 33370816..34dcf590 100644
--- a/src/interpreter.ml
+++ b/src/interpreter.ml
@@ -422,7 +422,11 @@ let rec step (E_aux (e_aux, annot) as orig_exp) =
fail "Wrong number of parameters to barrier intrinsic"
end
| _ ->
- get_primop extern >>= fun op -> return (exp_of_value (op (List.map value_of_exp evaluated)))
+ prerr_endline ("calling get_primop for '" ^ extern ^ "' with args (" ^ String.concat ", " (List.map string_of_exp evaluated) ^ ")");
+ get_primop extern >>=
+ fun op -> try
+ return (exp_of_value (op (List.map value_of_exp evaluated)))
+ with _ as exc -> fail ("Exception calling primop '" ^ extern ^ "': " ^ Printexc.to_string exc)
end
| [] ->
call id (List.map value_of_exp evaluated) >>=