From e7544933642aed69e6f01b5cbf4b66a6ca3a21fd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?C=C3=A9dric=20Pasteur?= Date: Thu, 23 Jun 2011 10:51:25 +0200 Subject: [PATCH] Fixed stateful bit for iterated nodes --- compiler/heptagon/analysis/stateful.ml | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/compiler/heptagon/analysis/stateful.ml b/compiler/heptagon/analysis/stateful.ml index 2daae49..e791c2c 100644 --- a/compiler/heptagon/analysis/stateful.ml +++ b/compiler/heptagon/analysis/stateful.ml @@ -45,6 +45,11 @@ let edesc funs stateful ed = let ty_desc = find_value f in let op = if ty_desc.node_stateful then Enode f else Efun f in Eapp({ app with a_op = op }, e_list, r), ty_desc.node_stateful or stateful + | Eiterator(it, ({ a_op = (Enode f | Efun f) } as app), n, pe_list, e_list, r) -> + let ty_desc = find_value f in + let op = if ty_desc.node_stateful then Enode f else Efun f in + Eiterator(it, { app with a_op = op }, n, pe_list, e_list, r), + ty_desc.node_stateful or stateful | _ -> ed, stateful (* Automatons have an hidden state whatever *)