aboutsummaryrefslogtreecommitdiff
path: root/checker/validate.ml
diff options
context:
space:
mode:
Diffstat (limited to 'checker/validate.ml')
-rw-r--r--checker/validate.ml13
1 files changed, 8 insertions, 5 deletions
diff --git a/checker/validate.ml b/checker/validate.ml
index c214409a2c..72cf38ebe6 100644
--- a/checker/validate.ml
+++ b/checker/validate.ml
@@ -86,6 +86,7 @@ let rec val_gen v ctx o = match v with
| Annot (s,v) -> val_gen v (ctx/CtxAnnot s) o
| Dyn -> val_dyn ctx o
| Proxy { contents = v } -> val_gen v ctx o
+ | Uint63 -> val_uint63 ctx o
(* Check that an object is a tuple (or a record). vs is an array of
value representation for each field. Its size corresponds to the
@@ -133,6 +134,10 @@ and val_array v ctx o =
val_gen v ctx (Obj.field o i)
done
+and val_uint63 ctx o =
+ if not (Uint63.is_uint63 o) then
+ fail ctx o "not a 63-bit unsigned integer"
+
let print_frame = function
| CtxType t -> t
| CtxAnnot t -> t
@@ -143,10 +148,8 @@ let validate debug v x =
let o = Obj.repr x in
try val_gen v mt_ec o
with ValidObjError(msg,ctx,obj) ->
- if debug then begin
+ (if debug then
let ctx = List.rev_map print_frame ctx in
- print_endline ("Validation failed: "^msg);
print_endline ("Context: "^String.concat"/"ctx);
- pr_obj obj
- end;
- failwith "vo structure validation failed"
+ pr_obj obj);
+ failwith ("Validation failed: "^msg^" (in "^(print_frame (List.hd ctx))^")")