diff options
author | xleroy <xleroy@fca1b0fc-160b-0410-b1d3-a4f43f01ea2e> | 2008-04-16 14:03:47 +0000 |
---|---|---|
committer | xleroy <xleroy@fca1b0fc-160b-0410-b1d3-a4f43f01ea2e> | 2008-04-16 14:03:47 +0000 |
commit | 3a34c43569ae9fdd3b170f26cba628d3aae5e336 (patch) | |
tree | 7b54ea317ffb2a53f6437da829698dbc022d5863 /caml/Camlcoq.ml | |
parent | c460156b067b439738104f3947287adbbef926a5 (diff) | |
download | compcert-3a34c43569ae9fdd3b170f26cba628d3aae5e336.tar.gz compcert-3a34c43569ae9fdd3b170f26cba628d3aae5e336.zip |
Camlcoq.ml: interpret Caml's int32 as unsigned when converting to Integers.int
Cil2Csyntax.ml: terminating NUL character in strings within initialized data
git-svn-id: https://yquem.inria.fr/compcert/svn/compcert/trunk@615 fca1b0fc-160b-0410-b1d3-a4f43f01ea2e
Diffstat (limited to 'caml/Camlcoq.ml')
-rw-r--r-- | caml/Camlcoq.ml | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/caml/Camlcoq.ml b/caml/Camlcoq.ml index d60e0222..e9089cf3 100644 --- a/caml/Camlcoq.ml +++ b/caml/Camlcoq.ml @@ -51,7 +51,9 @@ let z_of_camlint n = if n > 0l then Zpos (positive_of_camlint n) else Zneg (positive_of_camlint (Int32.neg n)) -let coqint_of_camlint : int32 -> Integers.int = z_of_camlint +let coqint_of_camlint (n: int32) : Integers.int = + (* Interpret n as unsigned so that resulting Z is in range *) + if n = 0l then Z0 else Zpos (positive_of_camlint n) (* Atoms (positive integers representing strings) *) |