From b3f98d84cf4c6f486336e9788e70e3d34a8fd903 Mon Sep 17 00:00:00 2001 From: Chris Hanson Date: Sat, 13 Jun 1987 00:14:10 +0000 Subject: [PATCH] When counting the operands of a combination, do not include operands which do not push any values. This means that `length' is not adequate for computing the number of operands. Instead use the new procedure `count-operands'. --- v7/src/compiler/rtlgen/rgcomb.scm | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/v7/src/compiler/rtlgen/rgcomb.scm b/v7/src/compiler/rtlgen/rgcomb.scm index ba7ff983b..770e1d7fc 100644 --- a/v7/src/compiler/rtlgen/rgcomb.scm +++ b/v7/src/compiler/rtlgen/rgcomb.scm @@ -1,6 +1,6 @@ #| -*-Scheme-*- -$Header: /Users/cph/tmp/foo/mit-scheme/mit-scheme/v7/src/compiler/rtlgen/rgcomb.scm,v 1.24 1987/06/12 21:51:10 cph Exp $ +$Header: /Users/cph/tmp/foo/mit-scheme/mit-scheme/v7/src/compiler/rtlgen/rgcomb.scm,v 1.25 1987/06/13 00:14:10 cph Exp $ Copyright (c) 1987 Massachusetts Institute of Technology @@ -369,7 +369,7 @@ MIT in each case. |# (define (make-call push-operator? combination operator operands generator) (let ((callee (combination-known-operator combination)) - (n-operands (length operands)) + (n-operands (count-operands operands)) (finish (lambda (frame-size) (scfg-append! @@ -408,6 +408,16 @@ MIT in each case. |# (loop (-1+ n)))))) (finish n-parameters))) (finish n-operands)))) + +(define (count-operands operands) + (cond ((null? operands) + 0) + ((transmit-values (car operands) + (lambda (cfg prefix expression) + expression)) + (1+ (count-operands (cdr operands)))) + (else + (count-operands (cdr operands))))) ;;;; Prefixes -- 2.25.1