There is no need to do a lookup: checking if the label's symbol is in the NS_LABEL namespace and is lacking an associated statement is enough and much simpler. Signed-off-by: Luc Van Oostenryck <luc.vanoostenryck@xxxxxxxxx> --- evaluate.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/evaluate.c b/evaluate.c index a432d243610e..dc66b2e6ad9a 100644 --- a/evaluate.c +++ b/evaluate.c @@ -3746,7 +3746,8 @@ static void evaluate_goto_statement(struct statement *stmt) evaluate_expression(stmt->goto_expression); return; } - if (!label->stmt && label->ident && !lookup_keyword(label->ident, NS_KEYWORD)) { + + if (label->namespace == NS_LABEL && !label->stmt) { sparse_error(stmt->pos, "label '%s' was not declared", show_ident(label->ident)); } } -- 2.26.0