From: Stephen Adams Date: Sat, 9 Mar 1996 15:23:41 +0000 (+0000) Subject: Added a check for valid arity when trying to constant fold a primitive. X-Git-Tag: 20090517-FFI~5659 X-Git-Url: https://birchwood-abbey.net/git?a=commitdiff_plain;h=c6fe953a1844228d40955603e54c21142cda30fc;p=mit-scheme.git Added a check for valid arity when trying to constant fold a primitive. --- 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))