diff options
author | François Pottier <francois.pottier@inria.fr> | 2015-10-23 15:08:33 +0200 |
---|---|---|
committer | François Pottier <francois.pottier@inria.fr> | 2015-10-23 15:17:50 +0200 |
commit | 136986c204af19341aeb455d72fe817b16fa6fff (patch) | |
tree | 02e9178d9f2cf942bd32366891d480ff161406f6 /cparser/Ceval.ml | |
parent | c46723c0169145d41d1879c236f53314456f1ba1 (diff) | |
parent | 1cb3d93ff278ebbd0c6967c5f9401a97f9b618b4 (diff) | |
download | compcert-136986c204af19341aeb455d72fe817b16fa6fff.tar.gz compcert-136986c204af19341aeb455d72fe817b16fa6fff.zip |
Merge remote branch 'upstream/master' into clean
Conflicts:
Makefile.extr
Diffstat (limited to 'cparser/Ceval.ml')
-rw-r--r-- | cparser/Ceval.ml | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/cparser/Ceval.ml b/cparser/Ceval.ml index ba7cdabc..74b535d4 100644 --- a/cparser/Ceval.ml +++ b/cparser/Ceval.ml @@ -124,7 +124,7 @@ let comparison env direction ptraction tyop ty1 v1 ty2 v2 = (* tyop = type at which the comparison is done *) let b = match cast env tyop ty1 v1, cast env tyop ty2 v2 with - | I n1, I n2 -> + | I n1, I n2 -> if is_signed env tyop then direction (compare n1 n2) 0 else direction (int64_unsigned_compare n1 n2) 0 (* including pointers *) @@ -162,7 +162,7 @@ let binop env op tyop tyres ty1 v1 ty2 v2 = end | Odiv -> begin match cast env tyop ty1 v1, cast env tyop ty2 v2 with - | I n1, I n2 -> + | I n1, I n2 -> if n2 = 0L then raise Notconst else if is_signed env tyop then I (Int64.div n1 n2) else I (int64_unsigned_div n1 n2) @@ -170,7 +170,7 @@ let binop env op tyop tyres ty1 v1 ty2 v2 = end | Omod -> begin match v1, v2 with - | I n1, I n2 -> + | I n1, I n2 -> if n2 = 0L then raise Notconst else if is_signed env tyop then I (Int64.rem n1 n2) else I (int64_unsigned_mod n1 n2) @@ -220,11 +220,11 @@ let binop env op tyop tyres ty1 v1 ty2 v2 = | Ocomma -> v2 | Ologand -> - if boolean_value v1 + if boolean_value v1 then if boolean_value v2 then I 1L else I 0L else I 0L | Ologor -> - if boolean_value v1 + if boolean_value v1 then I 1L else if boolean_value v2 then I 1L else I 0L | _ -> raise Notconst |