From 984e2612d2174390a54a36a805051c3f66cf6250 Mon Sep 17 00:00:00 2001
From: Kamil Dudka <kdudka@redhat.com>
Date: Sat, 18 Jul 2009 23:16:53 +0200
Subject: [PATCH] compile-i386: do not generate infinite loop
Signed-off-by: Kamil Dudka <kdudka@redhat.com>
---
compile-i386.c | 8 ++++----
1 files changed, 4 insertions(+), 4 deletions(-)
@@ -1913,6 +1913,10 @@ static void emit_loop(struct statement *stmt)
x86_symbol_decl(stmt->iterator_syms);
x86_statement(pre_statement);
+ if (!post_condition || post_condition->type != EXPR_VALUE || post_condition->value) {
+ loop_top = new_label();
+ emit_label(loop_top, "loop top");
+ }
if (pre_condition) {
if (pre_condition->type == EXPR_VALUE) {
if (!pre_condition->value) {
@@ -1936,10 +1940,6 @@ static void emit_loop(struct statement *stmt)
insn("jz", lbv, NULL, NULL);
}
}
- if (!post_condition || post_condition->type != EXPR_VALUE || post_condition->value) {
- loop_top = new_label();
- emit_label(loop_top, "loop top");
- }
x86_statement(statement);
if (stmt->iterator_continue->used)
emit_label(loop_continue, "'continue' iterator");
--
1.6.3.3