Squashed one more bug in the switch statement
git-svn-id: svn://svn.cc65.org/cc65/trunk@816 b7a2c559-68d2-44c3-8de9-860c34a00d81
This commit is contained in:
@@ -329,6 +329,9 @@ static void CascadeSwitch (ExprDesc* Expr)
|
|||||||
long Val; /* Case label value */
|
long Val; /* Case label value */
|
||||||
|
|
||||||
|
|
||||||
|
/* Get the unqualified type of the switch expression */
|
||||||
|
type ExprType = UnqualifiedType (Expr->Type[0]);
|
||||||
|
|
||||||
/* Create a loop so we may break out, init labels */
|
/* Create a loop so we may break out, init labels */
|
||||||
ExitLab = GetLocalLabel ();
|
ExitLab = GetLocalLabel ();
|
||||||
AddLoop (oursp, 0, ExitLab, 0, 0);
|
AddLoop (oursp, 0, ExitLab, 0, 0);
|
||||||
@@ -381,7 +384,7 @@ static void CascadeSwitch (ExprDesc* Expr)
|
|||||||
|
|
||||||
/* Check the range of the expression */
|
/* Check the range of the expression */
|
||||||
Val = lval.ConstVal;
|
Val = lval.ConstVal;
|
||||||
switch (*Expr->Type) {
|
switch (ExprType) {
|
||||||
|
|
||||||
case T_SCHAR:
|
case T_SCHAR:
|
||||||
/* Signed char */
|
/* Signed char */
|
||||||
@@ -409,7 +412,7 @@ static void CascadeSwitch (ExprDesc* Expr)
|
|||||||
break;
|
break;
|
||||||
|
|
||||||
default:
|
default:
|
||||||
Internal ("Invalid type: %02X", *Expr->Type & 0xFF);
|
Internal ("Invalid type: %04X", ExprType);
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Emit a compare */
|
/* Emit a compare */
|
||||||
|
|||||||
Reference in New Issue
Block a user