]> git.sur5r.net Git - cc65/commitdiff
Indexing a string by an expression which was not a simple variable didn't
authoruz <uz@b7a2c559-68d2-44c3-8de9-860c34a00d81>
Tue, 5 Aug 2008 21:20:42 +0000 (21:20 +0000)
committeruz <uz@b7a2c559-68d2-44c3-8de9-860c34a00d81>
Tue, 5 Aug 2008 21:20:42 +0000 (21:20 +0000)
work:  "abcd"[atoi("2")];

git-svn-id: svn://svn.cc65.org/cc65/trunk@3880 b7a2c559-68d2-44c3-8de9-860c34a00d81

src/cc65/expr.c

index 9a803848cc7f9e2e96fd369e73308a5e9fbcfc36..c80c42cf89b4eaa79b68327a6b27a1fa5ddca675 100644 (file)
@@ -80,7 +80,9 @@ static unsigned GlobalModeFlags (const ExprDesc* Expr)
 /* Return the addressing mode flags for the given expression */
 {
     switch (ED_GetLoc (Expr)) {
+        case E_LOC_ABS:         return CF_ABSOLUTE;
         case E_LOC_GLOBAL:      return CF_EXTERNAL;
+        case E_LOC_LITERAL:     /* Same as static */
         case E_LOC_STATIC:      return CF_STATIC;
         case E_LOC_REGISTER:    return CF_REGVAR;
         default:
@@ -1165,7 +1167,7 @@ void Store (ExprDesc* Expr, const Type* StoreType)
 
     /* Prepare the code generator flags */
     Flags = TypeOf (StoreType);
-
+                   
     /* Do the store depending on the location */
     switch (ED_GetLoc (Expr)) {