No functional changes here, only changing the code structure to prepare more incoming changes. Signed-off-by: Luc Van Oostenryck <luc.vanoostenryck@xxxxxxxxx> --- evaluate.c | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/evaluate.c b/evaluate.c index c18ae81df5ad..4bdd5ed05842 100644 --- a/evaluate.c +++ b/evaluate.c @@ -3742,10 +3742,14 @@ static void evaluate_goto_statement(struct statement *stmt) { struct symbol *label = stmt->goto_label; - if (label && !label->stmt && label->ident && !lookup_keyword(label->ident, NS_KEYWORD)) + if (!label) { + // no label associated, may be a computed goto + evaluate_expression(stmt->goto_expression); + return; + } + if (!label->stmt && label->ident && !lookup_keyword(label->ident, NS_KEYWORD)) { sparse_error(stmt->pos, "label '%s' was not declared", show_ident(label->ident)); - - evaluate_expression(stmt->goto_expression); + } } struct symbol *evaluate_statement(struct statement *stmt) -- 2.26.2