From de85b58248736fcef4a0d94b5c87bd171dcc0188 Mon Sep 17 00:00:00 2001
From: ram <ram>
Date: Sat, 16 Nov 1991 15:41:39 +0000
Subject: [PATCH] Fixed the VALUES IR1 transform (which discards unused values
 forms) to work when there are no values forms.

---
 compiler/ir1opt.lisp | 12 +++++++-----
 1 file changed, 7 insertions(+), 5 deletions(-)

diff --git a/compiler/ir1opt.lisp b/compiler/ir1opt.lisp
index c6da4f985..73ce82d7a 100644
--- a/compiler/ir1opt.lisp
+++ b/compiler/ir1opt.lisp
@@ -7,7 +7,7 @@
 ;;; Scott Fahlman or slisp-group@cs.cmu.edu.
 ;;;
 (ext:file-comment
-  "$Header: /Volumes/share2/src/cmucl/cvs2git/cvsroot/src/compiler/ir1opt.lisp,v 1.32 1991/11/16 13:16:37 ram Exp $")
+  "$Header: /Volumes/share2/src/cmucl/cvs2git/cvsroot/src/compiler/ir1opt.lisp,v 1.33 1991/11/16 15:41:39 ram Exp $")
 ;;;
 ;;; **********************************************************************
 ;;;
@@ -1531,11 +1531,13 @@
   (when (typep (continuation-dest (node-cont node))
 	       '(or creturn exit mv-combination))
     (give-up))
-  (let ((dummies (loop repeat (1- (length vals))
+  (if vals
+      (let ((dummies (loop repeat (1- (length vals))
 		       collect (gensym))))
-    `(lambda (val ,@dummies)
-       (declare (ignore ,@dummies))
-       val)))
+	`(lambda (val ,@dummies)
+	   (declare (ignore ,@dummies))
+	   val))
+      'nil))
 
 
 ;;; Flush-Dead-Code  --  Internal
-- 
GitLab