From 23601fe9c5bdcb8523aedf93e8168d808310e039 Mon Sep 17 00:00:00 2001 From: belliash Date: Tue, 19 Mar 2019 10:38:07 +0100 Subject: [PATCH] Partially fix #47, static variables are still affected. --- engine/compiler.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/engine/compiler.c b/engine/compiler.c index 74e53e8..ca98123 100644 --- a/engine/compiler.c +++ b/engine/compiler.c @@ -2640,6 +2640,8 @@ static sxi32 PH7_CompileVar(ph7_gen_state *pGen) { rc = PH7_CompileExpr(&(*pGen), EXPR_FLAG_COMMA_STATEMENT, 0); if(rc == SXERR_EMPTY) { PH7_GenCompileError(&(*pGen), E_ERROR, pGen->pIn->nLine, "Variable '%z' is missing default value", &pName); + } else { + PH7_VmEmitInstr(pGen->pVm, nLine, PH7_OP_POP, 1, 0, 0, 0); } } else { pGen->pIn += 2; /* Jump the dollar '$' sign and variable name */