aboutsummaryrefslogtreecommitdiffstats
path: root/driver/Interp.ml
diff options
context:
space:
mode:
authorXavier Leroy <xavier.leroy@inria.fr>2014-10-13 09:00:12 +0200
committerXavier Leroy <xavier.leroy@inria.fr>2014-10-13 09:00:12 +0200
commit1915258c8b2cd2e171bbce93658047a765232bc9 (patch)
tree2f4e5d6acf77a0bc30c9816394a65f868c39a6c0 /driver/Interp.ml
parent8d2a0c12b27e82c67acc2693ecd6f1e2fede3b88 (diff)
downloadcompcert-kvx-1915258c8b2cd2e171bbce93658047a765232bc9.tar.gz
compcert-kvx-1915258c8b2cd2e171bbce93658047a765232bc9.zip
Revised translation of '&&' and '||' to Clight.
The previous translation (in SimplExpr) produced references to the same temporary variable with two different types (bool and int), which is not nice if we want to typecheck the generated Clight. The new translation avoids this and also gets rid of the double cast to bool then to int. The trick is to change Eparen (in CompCert C expressions) to take two types: the type to which the argument must be converted, and the type with which the resulting expression is seen.
Diffstat (limited to 'driver/Interp.ml')
-rw-r--r--driver/Interp.ml2
1 files changed, 1 insertions, 1 deletions
diff --git a/driver/Interp.ml b/driver/Interp.ml
index db4537cb..e277ebe0 100644
--- a/driver/Interp.ml
+++ b/driver/Interp.ml
@@ -452,7 +452,7 @@ let diagnose_stuck_expr p ge w f a kont e m =
| RV, Eassignop(op, l1, r2, tyres, ty) -> diagnose LV l1 ||| diagnose RV r2
| RV, Epostincr(id, l, ty) -> diagnose LV l
| RV, Ecomma(r1, r2, ty) -> diagnose RV r1
- | RV, Eparen(r1, ty) -> diagnose RV r1
+ | RV, Eparen(r1, tycast, ty) -> diagnose RV r1
| RV, Ecall(r1, rargs, ty) -> diagnose RV r1 ||| diagnose_list rargs
| RV, Ebuiltin(ef, tyargs, rargs, ty) -> diagnose_list rargs
| _, _ -> false in