diff --git a/simgear/nasal/codegen.c b/simgear/nasal/codegen.c index 495456a6..0e3561c8 100644 --- a/simgear/nasal/codegen.c +++ b/simgear/nasal/codegen.c @@ -88,7 +88,12 @@ static int findConstantIndex(struct Parser* p, struct Token* t) if(t->type == TOK_SYMBOL) c = naInternSymbol(c); } else if(t->type == TOK_FUNC) c = newLambda(p, t); else if(t->type == TOK_LITERAL) c = naNum(t->num); - else naParseError(p, "invalid/non-constant constant", t->line); + else { + naParseError(p, "invalid/non-constant constant", t->line); + /* naParseError() doesn't return, but this stops compiler complaining + about not being set. */ + return -1; + } return internConstant(p, c); }