aboutsummaryrefslogtreecommitdiff
path: root/checker/validate.ml
diff options
context:
space:
mode:
authorPierre-Marie Pédrot2020-01-16 20:45:58 +0100
committerPierre-Marie Pédrot2020-01-16 20:49:16 +0100
commit849c5d47475164190659915304e601b436e9b9d3 (patch)
treeafb2ec2633297a89738a1892e07c99bd5145d523 /checker/validate.ml
parent25e50a61ca7a8f6698a1579ee262a9e57395e479 (diff)
Move the per-architecture check of marshalled Uint63s to Values.
Diffstat (limited to 'checker/validate.ml')
-rw-r--r--checker/validate.ml20
1 files changed, 9 insertions, 11 deletions
diff --git a/checker/validate.ml b/checker/validate.ml
index c3e7d18e56..6ffc43394b 100644
--- a/checker/validate.ml
+++ b/checker/validate.ml
@@ -66,14 +66,12 @@ let is_int _mem o = match o with
| Int _ -> true
| Fun _ | Ptr _ | Atm _ -> false
-let is_uint63 mem o =
- if Sys.word_size == 64 then is_int mem o
- else match o with
- | Int _ | Fun _ | Atm _ -> false
- | Ptr p ->
- match LargeArray.get mem p with
- | Int64 _ -> true
- | Float64 _ | Struct _ | String _ -> false
+let is_int64 mem o = match o with
+| Int _ | Fun _ | Atm _ -> false
+| Ptr p ->
+ match LargeArray.get mem p with
+ | Int64 _ -> true
+ | Float64 _ | Struct _ | String _ -> false
let is_float64 mem o = match o with
| Int _ | Fun _ | Atm _ -> false
@@ -147,7 +145,7 @@ let rec val_gen v mem ctx o = match v with
| Annot (s,v) -> val_gen v mem (ctx/CtxAnnot s) o
| Dyn -> val_dyn mem ctx o
| Proxy { contents = v } -> val_gen v mem ctx o
- | Uint63 -> val_uint63 mem ctx o
+ | Int64 -> val_int64 mem ctx o
| Float64 -> val_float64 mem ctx o
(* Check that an object is a tuple (or a record). vs is an array of
@@ -196,8 +194,8 @@ and val_array v mem ctx o =
val_gen v mem ctx (field mem o i)
done
-and val_uint63 mem ctx o =
- if not (is_uint63 mem o) then
+and val_int64 mem ctx o =
+ if not (is_int64 mem o) then
fail mem ctx o "not a 63-bit unsigned integer"
and val_float64 mem ctx o =