summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorChristoph Mallon <christoph.mallon@gmx.de>2018-05-24 23:38:53 +0200
committerChristoph Mallon <christoph.mallon@gmx.de>2018-05-31 07:00:54 +0200
commit23500c5cb0ae01b23019231cc05265ea882f9195 (patch)
tree9e4f64aae9f8c89a0ede2e56cf959e1956bcf8f2
parent82c814323ea63bcc1d5f132d9be61c3524ea83c8 (diff)
Consider the targets of asm goto reachable.
-rw-r--r--src/parser/parser.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/src/parser/parser.c b/src/parser/parser.c
index 8306216..77e5752 100644
--- a/src/parser/parser.c
+++ b/src/parser/parser.c
@@ -4740,7 +4740,14 @@ static void check_reachable(statement_t *const stmt)
switch (stmt->kind) {
case STATEMENT_ERROR:
case STATEMENT_EMPTY:
+ goto fallthrough;
+
case STATEMENT_ASM:
+ for (asm_label_t const *i = stmt->asms.labels; i; i = i->next) {
+ statement_t *const tgt = i->label->statement;
+ if (tgt)
+ check_reachable(tgt);
+ }
goto fallthrough;
case STATEMENT_DECLARATION: {