]> git.sur5r.net Git - cc65/blobdiff - src/cc65/asmstmt.c
Rewrote literal handling. Literals are now saved together with other function
[cc65] / src / cc65 / asmstmt.c
index b54771aa9332080baa0b851b1329ca8e379dc771..3f858c679f7a8501a6cde6f8b61c700a40db3fbd 100644 (file)
@@ -321,8 +321,7 @@ static void ParseStrArg (StrBuf* T, unsigned Arg attribute ((unused)))
 
         case TOK_SCONST:
             /* String constant */
-            SB_AppendStr (T, GetLiteral (CurTok.IVal));
-            ResetLiteralPoolOffs (CurTok.IVal);
+            SB_Append (T, GetLiteralStrBuf (CurTok.SVal));
             NextToken ();
             break;
 
@@ -347,14 +346,7 @@ static void ParseAsm (void)
 
     /* Create a string buffer from the string literal */
     StrBuf S = AUTO_STRBUF_INITIALIZER;
-    GetLiteralStrBuf (&S, CurTok.IVal);
-
-    /* Reset the string pointer, effectivly clearing the string from the
-     * string table. Since we're working with one token lookahead, this
-     * will fail if the next token is also a string token, but that's a
-     * syntax error anyway, because we expect a right paren.
-     */
-    ResetLiteralPoolOffs (CurTok.IVal);
+    SB_Append (&S, GetLiteralStrBuf (CurTok.SVal));
 
     /* Skip the string token */
     NextToken ();