summaryrefslogtreecommitdiff
path: root/toplevel/genprintval.ml
diff options
context:
space:
mode:
authorAlain Frisch <alain@frisch.fr>2013-10-23 14:28:31 +0000
committerAlain Frisch <alain@frisch.fr>2013-10-23 14:28:31 +0000
commit0f6f367ad4c2210bdf393ac60dbc0b6f7b8c796d (patch)
tree23038cc2fa16b7d37019e24012aaa22493ecd948 /toplevel/genprintval.ml
parentfe3afbdce8bbf5d1b959855aed4dec05f0ddba16 (diff)
downloadocaml-0f6f367ad4c2210bdf393ac60dbc0b6f7b8c796d.tar.gz
Change the representation of exception slots: instead of being represented as 'string ref', they are now blocks
of size 2, with tag = Object_tag, the first field being the pointer to the string, and second one being a unique id, generated from the same sequence as for object values. Special case for predefined exceptions, represented with a negative id. The unique id generator is moved from camlinternalOO to the C runtime system. Also fix some bugs. git-svn-id: http://caml.inria.fr/svn/ocaml/branches/raise_variants@14239 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
Diffstat (limited to 'toplevel/genprintval.ml')
-rw-r--r--toplevel/genprintval.ml8
1 files changed, 7 insertions, 1 deletions
diff --git a/toplevel/genprintval.ml b/toplevel/genprintval.ml
index 5ed3b073cd..c37b2884cd 100644
--- a/toplevel/genprintval.ml
+++ b/toplevel/genprintval.ml
@@ -79,6 +79,9 @@ module Make(O : OBJ)(EVP : EVALPATH with type valu = O.t) = struct
else []
let outval_of_untyped_exception bucket =
+ if O.tag bucket <> 0 then
+ Oval_constr (Oide_ident (O.obj (O.field bucket 0) : string), [])
+ else
let name = (O.obj(O.field(O.field bucket 0) 0) : string) in
let args =
if (name = "Match_failure"
@@ -349,7 +352,10 @@ module Make(O : OBJ)(EVP : EVALPATH with type valu = O.t) = struct
Oval_constr (lid, args)
and tree_of_exception depth bucket =
- let slot = if O.size bucket = 1 then bucket else O.field bucket 1 in
+ let slot =
+ if O.tag bucket <> 0 then bucket
+ else O.field bucket 0
+ in
let name = (O.obj(O.field slot 0) : string) in
let lid = Longident.parse name in
try