[PATCH 4/4] fix show-parse()'s labels

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

 



show_statement() sometimes displays BBs as "L0x0" because
it uses the symbol::bb_target field which is never set when
show_statement() is usefull (before or during linearization).

Fix this by using the address of the underlaying symbol like
done when displaying others BBs (for example for the label at
the beginning of a BB).

Signed-off-by: Luc Van Oostenryck <luc.vanoostenryck@xxxxxxxxx>
---
 show-parse.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/show-parse.c b/show-parse.c
index fb5437555..d365d737f 100644
--- a/show-parse.c
+++ b/show-parse.c
@@ -529,14 +529,14 @@ static void show_switch_statement(struct statement *stmt)
 			} else
 				printf("    what?");
 		}
-		printf(": .L%p\n", sym->bb_target);
+		printf(": .L%p\n", sym);
 	} END_FOR_EACH_PTR(sym);
 	printf("# end case table\n");
 
 	show_statement(stmt->switch_statement);
 
 	if (stmt->switch_break->used)
-		printf(".L%p:\n", stmt->switch_break->bb_target);
+		printf(".L%p:\n", stmt->switch_break);
 }
 
 static void show_symbol_decl(struct symbol_list *syms)
@@ -683,7 +683,7 @@ int show_statement(struct statement *stmt)
 			int val = show_expression(stmt->goto_expression);
 			printf("\tgoto\t\t*v%d\n", val);
 		} else {
-			printf("\tgoto\t\t.L%p\n", stmt->goto_label->bb_target);
+			printf("\tgoto\t\t.L%p\n", stmt->goto_label);
 		}
 		break;
 	case STMT_ASM:
-- 
2.11.0

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