]> git.sur5r.net Git - cc65/commitdiff
Add a missing type in range check
authorcuz <cuz@b7a2c559-68d2-44c3-8de9-860c34a00d81>
Thu, 11 Oct 2001 19:58:16 +0000 (19:58 +0000)
committercuz <cuz@b7a2c559-68d2-44c3-8de9-860c34a00d81>
Thu, 11 Oct 2001 19:58:16 +0000 (19:58 +0000)
git-svn-id: svn://svn.cc65.org/cc65/trunk@1038 b7a2c559-68d2-44c3-8de9-860c34a00d81

src/cc65/swstmt.c

index f085754d66f055037ce9c7c20aa35cf5f22a5c03..c1317449fedc55487cf660f0869a32c56844d846 100644 (file)
@@ -142,13 +142,15 @@ void SwitchStatement (void)
                            Error ("Range error");
                        }
                        break;
-
+                            
+                   case T_SHORT:
                    case T_INT:
                        if (Val < -32768 || Val > 32767) {
                            Error ("Range error");
                        }
                        break;
-
+                                
+                   case T_USHORT:
                    case T_UINT:
                        if (Val < 0 || Val > 65535) {
                            Error ("Range error");
@@ -225,7 +227,7 @@ void SwitchStatement (void)
 
     /* Eat the closing curly brace */
     NextToken ();
-                   
+
     /* Free the case value tree */
     FreeCaseNodeColl (Nodes);