diff options
author | xleroy <xleroy@fca1b0fc-160b-0410-b1d3-a4f43f01ea2e> | 2011-11-26 16:45:58 +0000 |
---|---|---|
committer | xleroy <xleroy@fca1b0fc-160b-0410-b1d3-a4f43f01ea2e> | 2011-11-26 16:45:58 +0000 |
commit | 72c07beb577658a7a91a6516910893ded124e9cb (patch) | |
tree | 218ad47150752de96f6bb4261962b445606f67fa /cfrontend/C2C.ml | |
parent | 60b6624ae2b28ebe9fb30c2aa6115e4d5c1ab436 (diff) |
More careful updating of current location for error msgs.
git-svn-id: https://yquem.inria.fr/compcert/svn/compcert/trunk@1739 fca1b0fc-160b-0410-b1d3-a4f43f01ea2e
Diffstat (limited to 'cfrontend/C2C.ml')
-rw-r--r-- | cfrontend/C2C.ml | 16 |
1 files changed, 10 insertions, 6 deletions
diff --git a/cfrontend/C2C.ml b/cfrontend/C2C.ml index 1287a7e..ee51914 100644 --- a/cfrontend/C2C.ml +++ b/cfrontend/C2C.ml @@ -654,14 +654,17 @@ let rec convertStmt env s = | C.Sseq(s1, s2) -> Ssequence(convertStmt env s1, convertStmt env s2) | C.Sif(e, s1, s2) -> - Sifthenelse(convertExpr env e, convertStmt env s1, convertStmt env s2) + let te = convertExpr env e in + Sifthenelse(te, convertStmt env s1, convertStmt env s2) | C.Swhile(e, s1) -> - Swhile(convertExpr env e, convertStmt env s1) + let te = convertExpr env e in + Swhile(te, convertStmt env s1) | C.Sdowhile(s1, e) -> - Sdowhile(convertExpr env e, convertStmt env s1) + let te = convertExpr env e in + Sdowhile(te, convertStmt env s1) | C.Sfor(s1, e, s2, s3) -> - Sfor(convertStmt env s1, convertExpr env e, convertStmt env s2, - convertStmt env s3) + let te = convertExpr env e in + Sfor(convertStmt env s1, te, convertStmt env s2, convertStmt env s3) | C.Sbreak -> Sbreak | C.Scontinue -> @@ -672,7 +675,8 @@ let rec convertStmt env s = unsupported "ill-formed 'switch' statement"; if init.sdesc <> C.Sskip then warning "ignored code at beginning of 'switch'"; - Sswitch(convertExpr env e, convertSwitch env cases) + let te = convertExpr env e in + Sswitch(te, convertSwitch env cases) | C.Slabeled(C.Slabel lbl, s1) -> Slabel(intern_string lbl, convertStmt env s1) | C.Slabeled(C.Scase _, _) -> |