From 5cd0b86a1a036a76e48fd6a597e579849d8889c4 Mon Sep 17 00:00:00 2001 From: uz Date: Tue, 5 Aug 2008 21:20:42 +0000 Subject: [PATCH] Indexing a string by an expression which was not a simple variable didn't work: "abcd"[atoi("2")]; git-svn-id: svn://svn.cc65.org/cc65/trunk@3880 b7a2c559-68d2-44c3-8de9-860c34a00d81 --- src/cc65/expr.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/cc65/expr.c b/src/cc65/expr.c index 9a803848c..c80c42cf8 100644 --- a/src/cc65/expr.c +++ b/src/cc65/expr.c @@ -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)) {