mirror of
https://github.com/cc65/cc65.git
synced 2025-08-08 22:25:28 +00:00
Fix an error with .ELSEIF: The condition must only be evaluated if the .ELSEIF
is inside an .IF which had a TRUE condition. git-svn-id: svn://svn.cc65.org/cc65/trunk@5036 b7a2c559-68d2-44c3-8de9-860c34a00d81
This commit is contained in:
@@ -229,6 +229,9 @@ void DoConditionals (void)
|
|||||||
/* Handle as if there was an .ELSE first */
|
/* Handle as if there was an .ELSE first */
|
||||||
ElseClause (D, ".ELSEIF");
|
ElseClause (D, ".ELSEIF");
|
||||||
|
|
||||||
|
/* Calculate the new overall if condition */
|
||||||
|
CalcOverallIfCond ();
|
||||||
|
|
||||||
/* Allocate and prepare a new descriptor */
|
/* Allocate and prepare a new descriptor */
|
||||||
D = AllocIf (".ELSEIF", 0);
|
D = AllocIf (".ELSEIF", 0);
|
||||||
NextTok ();
|
NextTok ();
|
||||||
@@ -237,7 +240,7 @@ void DoConditionals (void)
|
|||||||
* branch. This way we won't get any errors about undefined
|
* branch. This way we won't get any errors about undefined
|
||||||
* symbols or similar...
|
* symbols or similar...
|
||||||
*/
|
*/
|
||||||
if (IfCond == 0) {
|
if (IfCond) {
|
||||||
SetIfCond (D, ConstExpression ());
|
SetIfCond (D, ConstExpression ());
|
||||||
ExpectSep ();
|
ExpectSep ();
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user