diff --git a/compiler/debug.lisp b/compiler/debug.lisp
index 678be12c2c20c967669ca52d9e49502e3c343aa5..96a4d55ca7fa88069ca3e7fabd2559d2d2368718 100644
--- a/compiler/debug.lisp
+++ b/compiler/debug.lisp
@@ -681,7 +681,11 @@
     (let* ((info (vop-info vop))
 	   (atypes (template-arg-types info))
 	   (rtypes (template-result-types info)))
-      (check-tn-refs (vop-args vop) vop nil (length atypes)
+      (check-tn-refs (vop-args vop) vop nil
+		     (count-if-not #'(lambda (x)
+				       (and (consp x)
+					    (eq (car x) :constant)))
+				   atypes)
 		     (template-more-args-type info) "args")
       (check-tn-refs (vop-results vop) vop t
 		     (if (eq rtypes :conditional) 0 (length rtypes))