]> git.mxchange.org Git - simgear.git/commitdiff
Fix crash in the code generator when compiling a (now illegal, because
authorandy <andy>
Mon, 18 Apr 2005 20:43:29 +0000 (20:43 +0000)
committerandy <andy>
Mon, 18 Apr 2005 20:43:29 +0000 (20:43 +0000)
"var" is a reserved word) expresssion of the vorm "var=<expr>".

simgear/nasal/codegen.c

index c909c92888996436a37e48228799791029265b08..9451b5331a4df0fd674094a6fd3765ba307e680f 100644 (file)
@@ -155,7 +155,7 @@ static int genLValue(struct Parser* p, struct Token* t)
         genExpr(p, LEFT(t));
         genExpr(p, RIGHT(t));
         return OP_INSERT;
-    } else if(t->type == TOK_VAR && RIGHT(t)->type == TOK_SYMBOL) {
+    } else if(t->type == TOK_VAR && RIGHT(t) && RIGHT(t)->type == TOK_SYMBOL) {
         genScalarConstant(p, RIGHT(t));
         return OP_SETLOCAL;
     } else {