1
0
mirror of https://github.com/cc65/cc65.git synced 2024-12-25 17:29:50 +00:00

Fixed a problem with bit-fields: Values spanning more than a byte must always

be loaded as an int. This was not the case if the expression rhs was a char.


git-svn-id: svn://svn.cc65.org/cc65/trunk@4382 b7a2c559-68d2-44c3-8de9-860c34a00d81
This commit is contained in:
uz 2009-10-20 08:21:12 +00:00
parent 4372d111a2
commit 96b46beee0

View File

@ -100,8 +100,9 @@ void LoadExpr (unsigned Flags, struct ExprDesc* Expr)
* throw away the high byte anyway and may therefore load just the
* low byte.
*/
if (ED_IsBitField (Expr) && Expr->BitOffs + Expr->BitWidth <= CHAR_BITS) {
Flags |= CF_CHAR | CF_UNSIGNED;
if (ED_IsBitField (Expr)) {
Flags |= (Expr->BitOffs + Expr->BitWidth <= CHAR_BITS)? CF_CHAR : CF_INT;
Flags |= CF_UNSIGNED;
} else {
Flags |= TypeOf (Expr->Type);
}