From f8ecf3d76cd247d574dc88571538edd94c70dde9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?C=C3=A9dric=20Pasteur?= Date: Thu, 15 Jul 2010 11:57:47 +0200 Subject: [PATCH] Fixed Vars read function When is_left is true, the variables to the right of the fby should be ignored. --- compiler/minils/mls_utils.ml | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/compiler/minils/mls_utils.ml b/compiler/minils/mls_utils.ml index a03bf6f..efd264e 100644 --- a/compiler/minils/mls_utils.ml +++ b/compiler/minils/mls_utils.ml @@ -66,16 +66,20 @@ struct | Cbase | Cvar { contents = Cindex _ } -> acc | Cvar { contents = Clink ck } -> vars_ck acc ck - let read_exp read_funs (is_left, acc) e = + let read_exp read_funs (is_left, acc_init) e = (* recursive call *) - let _,(_, acc) = Mls_mapfold.exp read_funs (is_left, acc) e in + let _,(_, acc) = Mls_mapfold.exp read_funs (is_left, acc_init) e in (* special cases *) let acc = match e.e_desc with | Evar x | Emerge(x,_) | Ewhen(_, _, x) | Eapp(_, _, Some x) | Eiterator (_, _, _, _, Some x) -> add x acc | Efby(_, e) -> - if is_left then vars_ck acc e.e_ck else acc + if is_left then + (* do not consider variables to the right + of the fby, only clocks*) + vars_ck acc_init e.e_ck + else acc | _ -> acc in e, (is_left, vars_ck acc e.e_ck)