From 0692c66db39f52083620afd79acb3c9d17a4d333 Mon Sep 17 00:00:00 2001 From: uz Date: Sun, 1 Jan 2012 18:26:39 +0000 Subject: [PATCH] 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 --- src/cc65/typeconv.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/cc65/typeconv.c b/src/cc65/typeconv.c index d26ba32b2..ecde7349f 100644 --- a/src/cc65/typeconv.c +++ b/src/cc65/typeconv.c @@ -128,7 +128,7 @@ static void DoConversion (ExprDesc* Expr, const Type* NewType) Expr->IVal &= (0xFFFFFFFFUL >> (32 - NewBits)); /* If the new type is signed, sign extend the value */ - if (!IsSignUnsigned (NewType)) { + if (IsSignSigned (NewType)) { if (Expr->IVal & (0x01UL << (NewBits-1))) { /* Beware: Use the safe shift routine here. */ Expr->IVal |= shl_l (~0UL, NewBits); -- 2.39.5