From: sewardj Date: Mon, 22 Nov 1999 17:18:02 +0000 (+0000) Subject: [project @ 1999-11-22 17:18:02 by sewardj] X-Git-Tag: Approximately_9120_patches~5521 X-Git-Url: http://git.megacz.com/?a=commitdiff_plain;h=239da9986b9bb965190da6acd4c1a3bf6793e832;p=ghc-hetmet.git [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. --- diff --git a/ghc/interpreter/translate.c b/ghc/interpreter/translate.c index 4cac5b0..fb761d1 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;