diff options
author | Damien Doligez <damien.doligez-inria.fr> | 2014-08-22 13:45:02 +0000 |
---|---|---|
committer | Damien Doligez <damien.doligez-inria.fr> | 2014-08-22 13:45:02 +0000 |
commit | cbfe627f925ab2bab93bae7a7bc9f6ee6afb8637 (patch) | |
tree | af5ec283ac3175b1ab95dd745dbd05f2298b9da6 /toplevel | |
parent | 09ad9c1abbe6bee443a55379223280dab3de4749 (diff) | |
download | ocaml-cbfe627f925ab2bab93bae7a7bc9f6ee6afb8637.tar.gz |
merge changes from branch 4.02 from branching (rev 14852) to 4.02.0+rc1 (rev 15121)
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@15125 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
Diffstat (limited to 'toplevel')
-rw-r--r-- | toplevel/genprintval.ml | 2 | ||||
-rw-r--r-- | toplevel/trace.ml | 8 |
2 files changed, 7 insertions, 3 deletions
diff --git a/toplevel/genprintval.ml b/toplevel/genprintval.ml index 625a0a51b5..27f45a2d1b 100644 --- a/toplevel/genprintval.ml +++ b/toplevel/genprintval.ml @@ -258,7 +258,7 @@ module Make(O : OBJ)(EVP : EVALPATH with type valu = O.t) = struct Oval_array [] | Tconstr (path, [ty_arg], _) when Path.same path Predef.path_lazy_t -> - if Lazy.lazy_is_val (O.obj obj) + if Lazy.is_val (O.obj obj) then let v = nest tree_of_val depth (Lazy.force (O.obj obj)) ty_arg in diff --git a/toplevel/trace.ml b/toplevel/trace.ml index 60cfb95392..6690448363 100644 --- a/toplevel/trace.ml +++ b/toplevel/trace.ml @@ -96,14 +96,18 @@ let rec instrument_result env name ppf clos_typ = (* Same as instrument_result, but for a toplevel closure (modified in place) *) +exception Dummy +let _ = Dummy + let instrument_closure env name ppf clos_typ = match (Ctype.repr(Ctype.expand_head env clos_typ)).desc with | Tarrow(l, t1, t2, _) -> let trace_res = instrument_result env name ppf t2 in (fun actual_code closure arg -> if not !may_trace then begin - let res = invoke_traced_function actual_code closure arg - in res (* do not remove let, prevents tail-call to invoke_traced_ *) + try invoke_traced_function actual_code closure arg + with Dummy -> assert false + (* do not remove handler, prevents tail-call to invoke_traced_ *) end else begin may_trace := false; try |