From 066a5e0fec286feac1a46dde15365d009c32bfe3 Mon Sep 17 00:00:00 2001 From: acqn Date: Sun, 24 Jul 2022 16:38:41 +0800 Subject: [PATCH] Fixed #pragma charmap for string literals. --- src/cc65/expr.c | 2 ++ src/cc65/litpool.c | 6 ------ 2 files changed, 2 insertions(+), 6 deletions(-) diff --git a/src/cc65/expr.c b/src/cc65/expr.c index eb0afb38b..a506fa5a1 100644 --- a/src/cc65/expr.c +++ b/src/cc65/expr.c @@ -1263,6 +1263,8 @@ static void Primary (ExprDesc* E) /* String literal */ if ((Flags & E_EVAL_UNEVAL) != E_EVAL_UNEVAL) { E->V.LVal = UseLiteral (CurTok.SVal); + /* Translate into target charset */ + TranslateLiteral (E->V.LVal); } else { E->V.LVal = CurTok.SVal; } diff --git a/src/cc65/litpool.c b/src/cc65/litpool.c index 95228179d..d741f87d0 100644 --- a/src/cc65/litpool.c +++ b/src/cc65/litpool.c @@ -126,9 +126,6 @@ static void FreeLiteral (Literal* L) static void OutputLiteral (Literal* L) /* Output one literal to the currently active data segment */ { - /* Translate the literal into the target charset */ - TranslateLiteral (L); - /* Define the label for the literal */ g_defliterallabel (L->Label); @@ -387,9 +384,6 @@ static void OutputReadOnlyLiterals (Collection* Literals) continue; } - /* Translate the literal into the target charset */ - TranslateLiteral (L); - /* Check if this literal is part of another one. Since the literals ** are sorted by size (larger ones first), it can only be part of a ** literal with a smaller index.