Make wrong-arity primitives cause an error in addition to a warning.
authorArthur Gleckler <edu/mit/csail/zurich/arthur>
Wed, 1 Apr 1992 19:08:50 +0000 (19:08 +0000)
committerArthur Gleckler <edu/mit/csail/zurich/arthur>
Wed, 1 Apr 1992 19:08:50 +0000 (19:08 +0000)
(Jinx and Arthur)

v7/src/compiler/rtlgen/rgcomb.scm

index f10ab8e7d99d388cae00b3ffec270d6a34299b5b..5737950672b174cbf32afd9510ee79b1546b7790 100644 (file)
@@ -1,6 +1,6 @@
 #| -*-Scheme-*-
 
-$Header: /Users/cph/tmp/foo/mit-scheme/mit-scheme/v7/src/compiler/rtlgen/rgcomb.scm,v 4.16 1991/05/06 22:43:36 jinx Exp $
+$Header: /Users/cph/tmp/foo/mit-scheme/mit-scheme/v7/src/compiler/rtlgen/rgcomb.scm,v 4.17 1992/04/01 19:08:50 arthur Exp $
 
 Copyright (c) 1988-1991 Massachusetts Institute of Technology
 
@@ -159,7 +159,14 @@ MIT in each case. |#
   model                                        ; ignored
   (scfg*scfg->scfg!
    (prefix frame-size 0)
-   (let ((primitive (constant-value (rvalue-known-value operator))))
+   (let* ((primitive (constant-value (rvalue-known-value operator)))
+         (arity (primitive-procedure-arity primitive)))
+     (if (not (or (= arity -1)
+                 (= arity frame-size)))
+        (error "Primitive called with incorrect number of arguments."
+               primitive
+               arity
+               frame-size))
      ((or (special-primitive-handler primitive)
          rtl:make-invocation:primitive)
       (1+ frame-size)