mirror of
https://github.com/cc65/cc65.git
synced 2024-12-24 11:31:31 +00:00
Fixed a bug: To check for signed types use IsSignSigned, not !IsSignUnsigned.
The latter may be true for types and are neither signed nor unsigned. git-svn-id: svn://svn.cc65.org/cc65/trunk@5353 b7a2c559-68d2-44c3-8de9-860c34a00d81
This commit is contained in:
parent
9c841c19c8
commit
0692c66db3
@ -128,7 +128,7 @@ static void DoConversion (ExprDesc* Expr, const Type* NewType)
|
|||||||
Expr->IVal &= (0xFFFFFFFFUL >> (32 - NewBits));
|
Expr->IVal &= (0xFFFFFFFFUL >> (32 - NewBits));
|
||||||
|
|
||||||
/* If the new type is signed, sign extend the value */
|
/* If the new type is signed, sign extend the value */
|
||||||
if (!IsSignUnsigned (NewType)) {
|
if (IsSignSigned (NewType)) {
|
||||||
if (Expr->IVal & (0x01UL << (NewBits-1))) {
|
if (Expr->IVal & (0x01UL << (NewBits-1))) {
|
||||||
/* Beware: Use the safe shift routine here. */
|
/* Beware: Use the safe shift routine here. */
|
||||||
Expr->IVal |= shl_l (~0UL, NewBits);
|
Expr->IVal |= shl_l (~0UL, NewBits);
|
||||||
|
Loading…
Reference in New Issue
Block a user