From c6fe953a1844228d40955603e54c21142cda30fc Mon Sep 17 00:00:00 2001 From: Stephen Adams Date: Sat, 9 Mar 1996 15:23:41 +0000 Subject: [PATCH] Added a check for valid arity when trying to constant fold a primitive. --- v8/src/sf/subst.scm | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/v8/src/sf/subst.scm b/v8/src/sf/subst.scm index dfc53c01b..c12f1ae45 100644 --- a/v8/src/sf/subst.scm +++ b/v8/src/sf/subst.scm @@ -1,6 +1,6 @@ #| -*-Scheme-*- -$Id: subst.scm,v 1.3 1995/07/12 11:52:43 adams Exp $ +$Id: subst.scm,v 1.4 1996/03/09 15:23:41 adams Exp $ Copyright (c) 1988-1995 Massachusetts Institute of Technology @@ -972,7 +972,9 @@ forms are simply removed. (cond ( ;; fold constants (and (foldable-operator? operator) - (foldable-constants? operands)) + (foldable-constants? operands) + (procedure-arity-valid? (constant/value operator) + (length operands))) (let ((value (apply (constant/value operator) (map foldable-constant-value operands)))) (constant/make (and expression (object/scode expression)) -- 2.25.1