1
0
mirror of https://github.com/cc65/cc65.git synced 2025-01-17 20:30:36 +00:00

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
This commit is contained in:
uz 2013-01-25 20:45:40 +00:00
parent 63a0813979
commit 0eed753578

View File

@ -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);