1
0
mirror of https://github.com/cc65/cc65.git synced 2024-12-23 19:29:37 +00:00

Fixed a bug in CascadeSwitch

git-svn-id: svn://svn.cc65.org/cc65/trunk@813 b7a2c559-68d2-44c3-8de9-860c34a00d81
This commit is contained in:
cuz 2001-07-24 20:08:58 +00:00
parent 05eb03b32f
commit c5ccad1fc7

View File

@ -415,16 +415,18 @@ static void CascadeSwitch (ExprDesc* Expr)
/* Emit a compare */ /* Emit a compare */
g_cmp (Flags, Val); g_cmp (Flags, Val);
/* If another case follows, we will jump to the code if /* If another case follows after the colon (which is
* the condition is true. * currently pending and cannot be skipped since otherwise
*/ * the debug infos will get wrong), we will jump to the
if (CurTok.Tok == TOK_CASE) { * code if the condition is true.
*/
if (NextTok.Tok == TOK_CASE) {
/* Create a code label if needed */ /* Create a code label if needed */
if (CodeLab == 0) { if (CodeLab == 0) {
CodeLab = GetLocalLabel (); CodeLab = GetLocalLabel ();
} }
g_falsejump (CF_NONE, CodeLab); g_falsejump (CF_NONE, CodeLab);
} else if (CurTok.Tok != TOK_DEFAULT) { } else if (NextTok.Tok != TOK_DEFAULT) {
/* No case follows, jump to next selector */ /* No case follows, jump to next selector */
if (NextLab == 0) { if (NextLab == 0) {
NextLab = GetLocalLabel (); NextLab = GetLocalLabel ();