summaryrefslogtreecommitdiff
path: root/cparser/Ceval.ml
diff options
context:
space:
mode:
authorGravatar xleroy <xleroy@fca1b0fc-160b-0410-b1d3-a4f43f01ea2e>2013-10-13 10:02:52 +0000
committerGravatar xleroy <xleroy@fca1b0fc-160b-0410-b1d3-a4f43f01ea2e>2013-10-13 10:02:52 +0000
commit1d40928b2df6dd395c5c32a21f0ae41a56f74bea (patch)
treea177eddc6e7ec3d1fb9b65d98535815892f9ed64 /cparser/Ceval.ml
parenta6c369cbd63996c1571ae601b7d92070f024b22c (diff)
PackedStructs.ml: cleanups and bug-fixes
Ceval.ml: tolerate non-zero integers with pointer types. git-svn-id: https://yquem.inria.fr/compcert/svn/compcert/trunk@2343 fca1b0fc-160b-0410-b1d3-a4f43f01ea2e
Diffstat (limited to 'cparser/Ceval.ml')
-rw-r--r--cparser/Ceval.ml2
1 files changed, 1 insertions, 1 deletions
diff --git a/cparser/Ceval.ml b/cparser/Ceval.ml
index 504f7e0..6fb0d37 100644
--- a/cparser/Ceval.ml
+++ b/cparser/Ceval.ml
@@ -272,7 +272,7 @@ let constant_expr env ty e =
try
match unroll env ty, cast env ty e.etyp (expr env e) with
| TInt(ik, _), I n -> Some(CInt(n, ik, ""))
- | TPtr(_, _), I 0L -> Some(CInt(0L, IInt, ""))
+ | TPtr(_, _), I n -> Some(CInt(n, IInt, ""))
| TPtr(_, _), S s -> Some(CStr s)
| TPtr(_, _), WS s -> Some(CWStr s)
| TEnum(_, _), I n -> Some(CInt(n, enum_ikind, ""))