summaryrefslogtreecommitdiff
path: root/rts/RtsAPI.c
diff options
context:
space:
mode:
authorSimon Marlow <marlowsd@gmail.com>2008-09-30 11:56:11 +0000
committerSimon Marlow <marlowsd@gmail.com>2008-09-30 11:56:11 +0000
commitdeb41aa9252c516c73b896dd52712c7dd912621e (patch)
tree655904505ea0725570067069a8016e54469a37e4 /rts/RtsAPI.c
parenta5605c305ff873306ba0c495216736949fbf497b (diff)
downloadhaskell-deb41aa9252c516c73b896dd52712c7dd912621e.tar.gz
fix #2594: we were erroneously applying masks, as the reporter suggested
My guess is that this is left over from when we represented Int8 and friends as zero-extended rather than sign-extended. It's amazing it hasn't been noticed earlier.
Diffstat (limited to 'rts/RtsAPI.c')
-rw-r--r--rts/RtsAPI.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/rts/RtsAPI.c b/rts/RtsAPI.c
index 2496af3ea0..525ead25ac 100644
--- a/rts/RtsAPI.c
+++ b/rts/RtsAPI.c
@@ -51,7 +51,7 @@ rts_mkInt8 (Capability *cap, HsInt8 i)
StgClosure *p = (StgClosure *)allocateLocal(cap,CONSTR_sizeW(0,1));
SET_HDR(p, I8zh_con_info, CCS_SYSTEM);
/* Make sure we mask out the bits above the lowest 8 */
- p->payload[0] = (StgClosure *)(StgInt)((unsigned)i & 0xff);
+ p->payload[0] = (StgClosure *)(StgInt)i;
return p;
}
@@ -61,7 +61,7 @@ rts_mkInt16 (Capability *cap, HsInt16 i)
StgClosure *p = (StgClosure *)allocateLocal(cap,CONSTR_sizeW(0,1));
SET_HDR(p, I16zh_con_info, CCS_SYSTEM);
/* Make sure we mask out the relevant bits */
- p->payload[0] = (StgClosure *)(StgInt)((unsigned)i & 0xffff);
+ p->payload[0] = (StgClosure *)(StgInt)i;
return p;
}
@@ -70,7 +70,7 @@ rts_mkInt32 (Capability *cap, HsInt32 i)
{
StgClosure *p = (StgClosure *)allocateLocal(cap,CONSTR_sizeW(0,1));
SET_HDR(p, I32zh_con_info, CCS_SYSTEM);
- p->payload[0] = (StgClosure *)(StgInt)((unsigned)i & 0xffffffff);
+ p->payload[0] = (StgClosure *)(StgInt)i;
return p;
}