mirror of
https://github.com/cc65/cc65.git
synced 2024-07-31 11:29:16 +00:00
Fixed another bug in CascadeSwitch
git-svn-id: svn://svn.cc65.org/cc65/trunk@814 b7a2c559-68d2-44c3-8de9-860c34a00d81
This commit is contained in:
parent
c5ccad1fc7
commit
d982999f3e
@ -415,9 +415,9 @@ static void CascadeSwitch (ExprDesc* Expr)
|
|||||||
/* Emit a compare */
|
/* Emit a compare */
|
||||||
g_cmp (Flags, Val);
|
g_cmp (Flags, Val);
|
||||||
|
|
||||||
/* If another case follows after the colon (which is
|
/* If another case follows after the colon (which is
|
||||||
* currently pending and cannot be skipped since otherwise
|
* currently pending and cannot be skipped since otherwise
|
||||||
* the debug infos will get wrong), we will jump to the
|
* the debug infos will get wrong), we will jump to the
|
||||||
* code if the condition is true.
|
* code if the condition is true.
|
||||||
*/
|
*/
|
||||||
if (NextTok.Tok == TOK_CASE) {
|
if (NextTok.Tok == TOK_CASE) {
|
||||||
@ -443,7 +443,7 @@ static void CascadeSwitch (ExprDesc* Expr)
|
|||||||
NextToken ();
|
NextToken ();
|
||||||
|
|
||||||
/* Handle the pathologic case: DEFAULT followed by CASE */
|
/* Handle the pathologic case: DEFAULT followed by CASE */
|
||||||
if (CurTok.Tok == TOK_CASE) {
|
if (NextTok.Tok == TOK_CASE) {
|
||||||
if (CodeLab == 0) {
|
if (CodeLab == 0) {
|
||||||
CodeLab = GetLocalLabel ();
|
CodeLab = GetLocalLabel ();
|
||||||
}
|
}
|
||||||
@ -471,7 +471,7 @@ static void CascadeSwitch (ExprDesc* Expr)
|
|||||||
if (CurTok.Tok != TOK_RCURLY) {
|
if (CurTok.Tok != TOK_RCURLY) {
|
||||||
HaveBreak = Statement (0);
|
HaveBreak = Statement (0);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Check if we have any labels */
|
/* Check if we have any labels */
|
||||||
if (lcount == 0 && !HaveDefault) {
|
if (lcount == 0 && !HaveDefault) {
|
||||||
|
Loading…
Reference in New Issue
Block a user