summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorChristoph Mallon <christoph.mallon@gmx.de>2018-06-01 07:08:46 +0200
committerChristoph Mallon <christoph.mallon@gmx.de>2018-06-01 07:08:46 +0200
commitb4e8c130bd3c642220792b64fce2e506c0926de5 (patch)
tree2bf2a539fff191a072bdb7bdb946baead3aef6a3
parente367adeaba2a943a3d2b691378b80aa0342a3fa1 (diff)
Treat each occurrence of a label in asm goto as a use of the label.
-rw-r--r--src/parser/parser.c11
1 files changed, 9 insertions, 2 deletions
diff --git a/src/parser/parser.c b/src/parser/parser.c
index 77e5752..2a11fee 100644
--- a/src/parser/parser.c
+++ b/src/parser/parser.c
@@ -9173,6 +9173,12 @@ static void parse_asm_clobbers(asm_clobber_t **anchor)
}
}
+static void use_label(label_t *const label)
+{
+ label->n_users += 1;
+ label->used = true;
+}
+
static void parse_asm_labels(asm_label_t **anchor)
{
if (peek(T_IDENTIFIER)) {
@@ -9180,6 +9186,8 @@ static void parse_asm_labels(asm_label_t **anchor)
do {
label_t *const label = get_label("'asm goto' labels");
if (label) {
+ use_label(label);
+
asm_label_t *const asm_label = allocate_ast_zero(sizeof(*asm_label));
asm_label->label = label;
@@ -9922,8 +9930,7 @@ static statement_t *parse_goto(void)
label_t *const label = get_label("goto");
if (label) {
- label->n_users += 1;
- label->used = true;
+ use_label(label);
statement->gotos.label = label;
} else {
statement->gotos.label = &allocate_entity_zero(ENTITY_LABEL, NAMESPACE_LABEL, sym_anonymous, &builtin_position)->label;