From 239da9986b9bb965190da6acd4c1a3bf6793e832 Mon Sep 17 00:00:00 2001
From: sewardj <unknown>
Date: Mon, 22 Nov 1999 17:18:02 +0000
Subject: [PATCH] [project @ 1999-11-22 17:18:02 by sewardj] When generating
 wrapper code for primops/callouts with return type IO (), don't allocate a
 unit to return.  Instead, return the address of the unit closure.

---
 ghc/interpreter/translate.c | 10 +++++++---
 1 file changed, 7 insertions(+), 3 deletions(-)

diff --git a/ghc/interpreter/translate.c b/ghc/interpreter/translate.c
index 4cac5b0f545b..fb761d179153 100644
--- a/ghc/interpreter/translate.c
+++ b/ghc/interpreter/translate.c
@@ -10,8 +10,8 @@
  * included in the distribution.
  *
  * $RCSfile: translate.c,v $
- * $Revision: 1.16 $
- * $Date: 1999/11/16 17:38:58 $
+ * $Revision: 1.17 $
+ * $Date: 1999/11/22 17:18:02 $
  * ------------------------------------------------------------------------*/
 
 #include "prelude.h"
@@ -611,10 +611,14 @@ static StgPrimAlt boxResults( String reps, StgVar state )
         }
         rs = cons(v,rs);
     }
+
     /* Construct tuple of results */
+    if (i == 0) {
+        e = nameUnit;
+    } else
     if (i == 1) {
         e = hd(bs);
-    } else { /* includes i==0 case */
+    } else {
         StgVar r = mkStgVar(mkStgCon(mkTuple(i),rev(bs)),NIL);
         rbinds = cons(r,rbinds);
         e = r;
-- 
GitLab