From fe2bc26e7130ae856e92d2fe2b2e50ea3ec39c7a Mon Sep 17 00:00:00 2001 From: Cas Cremers Date: Fri, 19 Oct 2018 15:46:48 -0400 Subject: [PATCH] Removed one more. --- src/compiler.c | 22 ++++++++++------------ 1 file changed, 10 insertions(+), 12 deletions(-) diff --git a/src/compiler.c b/src/compiler.c index da2af09..adebaa1 100644 --- a/src/compiler.c +++ b/src/compiler.c @@ -2216,21 +2216,19 @@ checkRoleVariables (const System sys, const Protocol p, const Role r) { Termlist vars; Termlist declared; - - int process_event (Roledef rd) - { - if (rd->type == RECV) - { - vars = termlistAddVariables (vars, rd->from); - vars = termlistAddVariables (vars, rd->to); - vars = termlistAddVariables (vars, rd->message); - } - return 1; - } + Roledef rd; /* Gather all variables occurring in the recvs */ vars = NULL; - roledef_iterate_events (r->roledef, process_event); + for (rd = r->roledef; rd != NULL; rd = rd->next) + { + if (rd->type == RECV) + { + vars = termlistAddVariables (vars, rd->from); + vars = termlistAddVariables (vars, rd->to); + vars = termlistAddVariables (vars, rd->message); + } + } /* Now, all variables for this role should be in the recvs */ declared = r->declaredvars;