]> git.sur5r.net Git - cc65/commitdiff
Fix an error with .ELSEIF: The condition must only be evaluated if the .ELSEIF
authoruz <uz@b7a2c559-68d2-44c3-8de9-860c34a00d81>
Tue, 7 Jun 2011 17:16:18 +0000 (17:16 +0000)
committeruz <uz@b7a2c559-68d2-44c3-8de9-860c34a00d81>
Tue, 7 Jun 2011 17:16:18 +0000 (17:16 +0000)
is inside an .IF which had a TRUE condition.

git-svn-id: svn://svn.cc65.org/cc65/trunk@5036 b7a2c559-68d2-44c3-8de9-860c34a00d81

src/ca65/condasm.c

index bbf1089ccc380ceea36f5fd962d30057fa5afa7e..387ed15e8dd8afb55e77569f3faab5443d5a6715 100644 (file)
@@ -229,6 +229,9 @@ void DoConditionals (void)
                 /* Handle as if there was an .ELSE first */
                 ElseClause (D, ".ELSEIF");
 
+                /* Calculate the new overall if condition */
+                CalcOverallIfCond ();
+
                 /* Allocate and prepare a new descriptor */
                 D = AllocIf (".ELSEIF", 0);
                 NextTok ();
@@ -237,7 +240,7 @@ void DoConditionals (void)
                  * branch. This way we won't get any errors about undefined
                  * symbols or similar...
                  */
-                if (IfCond == 0) {
+                if (IfCond) {
                     SetIfCond (D, ConstExpression ());
                     ExpectSep ();
                 }