From ea1fcf0b447d9677859bc3d9692d29434b7fb5be Mon Sep 17 00:00:00 2001 From: Lu Guanqun Date: Wed, 22 Aug 2012 09:09:36 +0800 Subject: [PATCH] fix the label checking logics Signed-off-by: Lu Guanqun --- assembler/src/main.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/assembler/src/main.c b/assembler/src/main.c index 539c588e..e8f1e533 100644 --- a/assembler/src/main.c +++ b/assembler/src/main.c @@ -329,6 +329,7 @@ int main(int argc, char **argv) if (!entry->islabel) { if (entry->instruction.reloc_target) { entry1 = entry; + int found = 0; do { if (entry1->islabel && strcmp(entry1->string, @@ -343,13 +344,14 @@ int main(int argc, char **argv) if (entry->instruction.header.opcode == BRW_OPCODE_ELSE) entry->instruction.bits3.if_else.pop_count = 1; + found = 1; break; } entry1 = entry1->next; if (entry1 == NULL) entry1 = compiled_program.first; } while (entry1 != entry); - if (entry1 == NULL) + if (found == 0) fprintf(stderr, "can not find lable %s\n", entry->instruction.reloc_target); }