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 4bdd5ed05842..d4b462274add 100644 --- a/evaluate.c +++ b/evaluate.c @@ -3747,7 +3747,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.2