From a274818c64d90cc0596509cdf0021b69c6b9a506 Mon Sep 17 00:00:00 2001
From: Chris Hanson <org/chris-hanson/cph>
Date: Tue, 2 Jun 1987 18:44:05 +0000
Subject: [PATCH] Combination should be added to vnode-combinations of the
 operator vnode, if any.  Previously it was added to vnode-combinations of the
 combination-value, completely incorrect.

---
 v7/src/compiler/base/ctypes.scm | 14 ++++++++++----
 1 file changed, 10 insertions(+), 4 deletions(-)

diff --git a/v7/src/compiler/base/ctypes.scm b/v7/src/compiler/base/ctypes.scm
index 34615c584..2ffe49ad6 100644
--- a/v7/src/compiler/base/ctypes.scm
+++ b/v7/src/compiler/base/ctypes.scm
@@ -1,6 +1,6 @@
 #| -*-Scheme-*-
 
-$Header: /Users/cph/tmp/foo/mit-scheme/mit-scheme/v7/src/compiler/base/ctypes.scm,v 1.47 1987/05/15 19:49:56 cph Exp $
+$Header: /Users/cph/tmp/foo/mit-scheme/mit-scheme/v7/src/compiler/base/ctypes.scm,v 1.48 1987/06/02 18:44:05 cph Exp $
 
 Copyright (c) 1987 Massachusetts Institute of Technology
 
@@ -75,11 +75,17 @@ MIT in each case. |#
   (let ((combination
 	 (make-snode combination-tag block compilation-type value operator
 		     operands '() false false)))
+    (define (add-vnode-combination! vnode)
+      (set-vnode-combinations! vnode
+			       (cons combination (vnode-combinations vnode))))
     (set! *combinations* (cons combination *combinations*))
     (set-block-combinations! block
 			     (cons combination (block-combinations block)))
-    (set-vnode-combinations! value
-			     (cons combination (vnode-combinations value)))
+    (let ((rvalue (subproblem-value operator)))
+      (cond ((vnode? rvalue)
+	     (add-vnode-combination! rvalue))
+	    ((reference? rvalue)
+	     (add-vnode-combination! (reference-variable rvalue)))))
     (snode->scfg combination)))
 
 (define-integrable (combination-compiled-for-predicate? combination)
@@ -90,7 +96,7 @@ MIT in each case. |#
 
 (define-integrable (combination-compiled-for-value? combination)
   (eq? 'VALUE (combination-compilation-type combination)))
-
+
 (define-snode continuation rtl-edge label frame-pointer-offset)
 (define *continuations*)
 
-- 
2.25.1