Whenever we check the argument types, also check the argument number

This commit is contained in:
Juan Jose Garcia Ripoll 2010-05-09 23:54:01 +02:00
parent bb29cc908b
commit 8525362b33
2 changed files with 3 additions and 6 deletions

View file

@ -336,7 +336,7 @@ The function thus belongs to the type of functions that ecl_make_cfun accepts."
(baboon))
;; check arguments
(unless (or local-entry-p (not (compiler-check-args)))
(unless (or local-entry-p (not (policy-check-nargs)))
(incf *inline-blocks*)
(if (and use-narg (not varargs))
(wt-nl "if (ecl_unlikely(narg!=" nreq ")) FEwrong_num_arguments_anonym();")

View file

@ -212,7 +212,7 @@
(define-policy check-stack-overflow :on safety 2
"Add a stack check to every function")
(define-policy check-arguments-type :on safety 1
(define-policy ext:check-arguments-type :on safety 1
"Generate CHECK-TYPE forms for function arguments with type declarations")
(define-policy array-bounds-check :alias assume-no-errors
@ -224,7 +224,7 @@
(define-policy global-function-checking :alias assume-no-errors
"Read the binding of a global function even if it is discarded")
(define-policy check-nargs :on safety 1
(define-policy check-nargs :on safety 1 :on ext:check-arguments-type 1
"Check that the number of arguments a function receives is within bounds")
;;
@ -268,8 +268,5 @@ INTGERP, STRINGP.")
(defun safe-compile ()
(>= (cmp-env-optimization 'safety) 2))
(defun compiler-check-args ()
(>= (cmp-env-optimization 'safety) 1))
(defun compiler-push-events ()
(>= (cmp-env-optimization 'safety) 3))