linux-sparse.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 1/2] linearize: Emit C99 declarations correctly
@ 2016-05-04 12:39 Emily Maier
  2016-05-04 12:39 ` [PATCH 2/2] validation: Check C99 for loop variables Emily Maier
  2016-11-02 13:57 ` [PATCH 1/2] linearize: Emit C99 declarations correctly Luc Van Oostenryck
  0 siblings, 2 replies; 5+ messages in thread
From: Emily Maier @ 2016-05-04 12:39 UTC (permalink / raw)
  To: linux-sparse; +Cc: Emily Maier

Variables declared with C99 syntax inside a for statement should be
linearized in the loop top, rather than implicitly inside the loop body.

Signed-off-by: Emily Maier <emily@emilymaier.net>
---
 linearize.c | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/linearize.c b/linearize.c
index c6ada1e..1309c7d 100644
--- a/linearize.c
+++ b/linearize.c
@@ -1946,7 +1946,11 @@ static pseudo_t linearize_iterator(struct entrypoint *ep, struct statement *stmt
 	struct statement  *post_statement = stmt->iterator_post_statement;
 	struct expression *post_condition = stmt->iterator_post_condition;
 	struct basic_block *loop_top, *loop_body, *loop_continue, *loop_end;
+	struct symbol *sym;
 
+	FOR_EACH_PTR(stmt->iterator_syms, sym) {
+		linearize_one_symbol(ep, sym);
+	} END_FOR_EACH_PTR(sym);
 	concat_symbol_list(stmt->iterator_syms, &ep->syms);
 	linearize_statement(ep, pre_statement);
 
-- 
2.5.5


^ permalink raw reply related	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2016-11-17  9:14 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-05-04 12:39 [PATCH 1/2] linearize: Emit C99 declarations correctly Emily Maier
2016-05-04 12:39 ` [PATCH 2/2] validation: Check C99 for loop variables Emily Maier
2016-11-02 14:04   ` Luc Van Oostenryck
2016-11-02 13:57 ` [PATCH 1/2] linearize: Emit C99 declarations correctly Luc Van Oostenryck
2016-11-17  9:14   ` Christopher Li

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).