mirror of
https://github.com/cc65/cc65.git
synced 2025-01-26 17:36:57 +00:00
Disabled applying 'sizeof' to bit-fields.
This commit is contained in:
parent
62a6e37487
commit
b67b8ddd38
@ -1898,14 +1898,19 @@ 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);
|
||||
if (ED_IsBitField (Expr)) {
|
||||
Error ("Cannot apply 'sizeof' to bit-field");
|
||||
Size = 0;
|
||||
} else {
|
||||
/* 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);
|
||||
}
|
||||
/* Calculate the size */
|
||||
Size = CheckedSizeOf (Expr->Type);
|
||||
/* Remove any generated code */
|
||||
RemoveCode (&Mark);
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user