diff options
author | xleroy <xleroy@fca1b0fc-160b-0410-b1d3-a4f43f01ea2e> | 2012-02-10 10:23:43 +0000 |
---|---|---|
committer | xleroy <xleroy@fca1b0fc-160b-0410-b1d3-a4f43f01ea2e> | 2012-02-10 10:23:43 +0000 |
commit | 7cde5744d5fa12c76f46bcd180ecfe0b4d00afb8 (patch) | |
tree | b11e9aa1e3c97c7c1e53e8eab298aa65e7c2e8c1 /cparser | |
parent | 2594c23c95d22f838952b0b335231ba81a657b0d (diff) | |
download | compcert-7cde5744d5fa12c76f46bcd180ecfe0b4d00afb8.tar.gz compcert-7cde5744d5fa12c76f46bcd180ecfe0b4d00afb8.zip |
Interp: help debug stuck expressions
StructReturn: was building an ill-typed Ecomma expression
Cutil: export "ecast"
git-svn-id: https://yquem.inria.fr/compcert/svn/compcert/trunk@1816 fca1b0fc-160b-0410-b1d3-a4f43f01ea2e
Diffstat (limited to 'cparser')
-rw-r--r-- | cparser/Cutil.ml | 2 | ||||
-rw-r--r-- | cparser/Cutil.mli | 2 | ||||
-rw-r--r-- | cparser/StructReturn.ml | 5 |
3 files changed, 4 insertions, 5 deletions
diff --git a/cparser/Cutil.ml b/cparser/Cutil.ml index a3cb609c..eb3f0639 100644 --- a/cparser/Cutil.ml +++ b/cparser/Cutil.ml @@ -720,7 +720,7 @@ let nullconst = (* Construct a cast expression *) -let ecast e ty = { edesc = ECast(ty, e); etyp = ty } +let ecast ty e = { edesc = ECast(ty, e); etyp = ty } (* Construct an assignment expression *) diff --git a/cparser/Cutil.mli b/cparser/Cutil.mli index 051fafb9..3c39b99a 100644 --- a/cparser/Cutil.mli +++ b/cparser/Cutil.mli @@ -171,6 +171,8 @@ val nullconst : exp (* Expression for [(void * ) 0] *) val eaddrof : exp -> exp (* Expression for [&e] *) +val ecast : typ -> exp -> exp + (* Expression for [(ty)e] *) val eassign : exp -> exp -> exp (* Expression for [e1 = e2] *) val ecomma : exp -> exp -> exp diff --git a/cparser/StructReturn.ml b/cparser/StructReturn.ml index 2a4bbc19..57246ce1 100644 --- a/cparser/StructReturn.ml +++ b/cparser/StructReturn.ml @@ -65,10 +65,7 @@ let rec transf_expr env ctx e = when is_composite_type env ty -> transf_composite_call env ctx (Some lhs) fn args ty | EBinop(Ocomma, e1, e2, ty) -> - {edesc = EBinop(Ocomma, transf_expr env Effects e1, - transf_expr env ctx e2, - transf_type env ty); - etyp = newty} + ecomma (transf_expr env Effects e1) (transf_expr env ctx e2) | EBinop(op, e1, e2, ty) -> {edesc = EBinop(op, transf_expr env Val e1, transf_expr env Val e2, |