[PATCH 1/2] linearize: Emit C99 declarations correctly

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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@xxxxxxxxxxxxxx>
---
 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

--
To unsubscribe from this list: send the line "unsubscribe linux-sparse" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html



[Index of Archives]     [Newbies FAQ]     [LKML]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Trinity Fuzzer Tool]

  Powered by Linux