[project @ 2000-06-12 11:04:12 by simonmar]
authorsimonmar <unknown>
Mon, 12 Jun 2000 11:04:12 +0000 (11:04 +0000)
committersimonmar <unknown>
Mon, 12 Jun 2000 11:04:12 +0000 (11:04 +0000)
Fix a nasty bug: the 'c' component of StgUnion was declared as type
StgChar, which sounds reasonable, but meant that when assigning a char
to R1 gcc would correctly arrange to only overwrite the low byte
rather than zero-extending the value.  We assume elsewhere that when
R1 contains a char that the upper 24 bits are zero, so this was wrong.

This bug must have been around for a *long* time, strange that it only
just showed up. <shrug>

ghc/includes/StgTypes.h

index 4b367ac..e6b87f9 100644 (file)
@@ -1,5 +1,5 @@
 /* -----------------------------------------------------------------------------
- * $Id: StgTypes.h,v 1.11 2000/04/13 15:37:11 panne Exp $
+ * $Id: StgTypes.h,v 1.12 2000/06/12 11:04:12 simonmar Exp $
  *
  * (c) The GHC Team, 1998-1999
  *
@@ -160,7 +160,7 @@ typedef StgFunPtr StgFun(void);
 typedef union {
     StgWord        w;
     StgAddr        a;
-    StgChar        c;
+    StgWord        c;
     StgFloat       f;
     StgInt         i;
     StgPtr         p;