summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGravatar xleroy <xleroy@fca1b0fc-160b-0410-b1d3-a4f43f01ea2e>2010-08-04 14:49:09 +0000
committerGravatar xleroy <xleroy@fca1b0fc-160b-0410-b1d3-a4f43f01ea2e>2010-08-04 14:49:09 +0000
commitadedca3a1ff17ff8ac66eb2bcd533a50df0927a0 (patch)
tree319aaf0618a079d3c53c4153e3c637008fc6af28
parent07177cf17149b49232efe58b5189defbcb63f5d7 (diff)
Wrong cast in constant_expr
git-svn-id: https://yquem.inria.fr/compcert/svn/compcert/trunk@1449 fca1b0fc-160b-0410-b1d3-a4f43f01ea2e
-rw-r--r--cparser/Ceval.ml6
1 files changed, 3 insertions, 3 deletions
diff --git a/cparser/Ceval.ml b/cparser/Ceval.ml
index 0e22852..1630503 100644
--- a/cparser/Ceval.ml
+++ b/cparser/Ceval.ml
@@ -254,20 +254,20 @@ let rec expr env e =
| EConditional(e1, e2, e3) ->
if boolean_value (expr env e1) then expr env e2 else expr env e3
| ECast(ty, e1) ->
- cast env e1.etyp ty (expr env e1)
+ cast env ty e1.etyp (expr env e1)
| ECall _ ->
raise Notconst
let integer_expr env e =
try
- match cast env e.etyp (TInt(ILongLong, [])) (expr env e) with
+ match cast env (TInt(ILongLong, [])) e.etyp (expr env e) with
| I n -> Some n
| _ -> None
with Notconst -> None
let constant_expr env ty e =
try
- match unroll env ty, cast env e.etyp ty (expr env e) with
+ match unroll env ty, cast env ty e.etyp (expr env e) with
| TInt(ik, _), I n -> Some(CInt(n, ik, ""))
| TFloat(fk, _), F n -> Some(CFloat(n, fk, ""))
| TPtr(_, _), I 0L -> Some(CInt(0L, IInt, ""))