From: uz Date: Fri, 25 Jan 2013 20:45:40 +0000 (+0000) Subject: Prevent a literal string that is an argument for sizeof to be output into the X-Git-Tag: V2.14~106 X-Git-Url: https://git.sur5r.net/?a=commitdiff_plain;h=0eed753578c75a994bd3361ccf9882e46b120eb8;p=cc65 Prevent a literal string that is an argument for sizeof to be output into the literal pool. git-svn-id: svn://svn.cc65.org/cc65/trunk@5968 b7a2c559-68d2-44c3-8de9-860c34a00d81 --- diff --git a/src/cc65/expr.c b/src/cc65/expr.c index db1243cc2..9708ebe2c 100644 --- a/src/cc65/expr.c +++ b/src/cc65/expr.c @@ -1744,6 +1744,13 @@ void hie10 (ExprDesc* Expr) CodeMark Mark; GetCodePos (&Mark); hie10 (Expr); + /* If the expression is a literal string, release it, so it + * won't be output as data if not used elsewhere. + */ + if (ED_IsLocLiteral (Expr)) { + ReleaseLiteral (Expr->LVal); + } + /* Calculate the size */ Size = CheckedSizeOf (Expr->Type); /* Remove any generated code */ RemoveCode (&Mark);