]> git.mxchange.org Git - simgear.git/commitdiff
Fix crash in code generator for some bad lvalue expressions
authorandy <andy>
Wed, 1 Aug 2007 22:33:01 +0000 (22:33 +0000)
committerandy <andy>
Wed, 1 Aug 2007 22:33:01 +0000 (22:33 +0000)
simgear/nasal/codegen.c

index a0fcd91bfc3300043ed4cccf00940db11088787c..15276e8c96ec4f59c68278c49eb1a45749371e76 100644 (file)
@@ -110,6 +110,7 @@ static int genScalarConstant(struct Parser* p, struct Token* t)
 
 static int genLValue(struct Parser* p, struct Token* t, int* cidx)
 {
+    if(!t) naParseError(p, "bad lvalue", -1);
     if(t->type == TOK_LPAR && t->rule != PREC_SUFFIX) {
         return genLValue(p, LEFT(t), cidx); // Handle stuff like "(a) = 1"
     } else if(t->type == TOK_SYMBOL) {