From aca02b8281ae657a435a168576b0b695d3b231af Mon Sep 17 00:00:00 2001
From: ram <ram>
Date: Mon, 21 May 1990 17:03:06 +0000
Subject: [PATCH] Changed PROBABLE-TYPE-CHECK-P to return T when we are unable
 to determine when VALID-FUNCTION-USE is unable to determine the whether the
 template applies.  If the VOP operand is unrestrictive, but we know it is of
 an unknown type, then the type-operation will fail but the template can still
 be selected, since PRIMITIVE-TYPE isn't fooled.

---
 compiler/checkgen.lisp | 9 +++++----
 1 file changed, 5 insertions(+), 4 deletions(-)

diff --git a/compiler/checkgen.lisp b/compiler/checkgen.lisp
index 11832e35a..d3c55eaad 100644
--- a/compiler/checkgen.lisp
+++ b/compiler/checkgen.lisp
@@ -231,10 +231,11 @@
 		   ((function-info-ir2-convert kind) t)
 		   (t
 		    (dolist (template (function-info-templates kind) nil)
-		      (when (and (eq (template-policy template) :fast-safe)
-				 (valid-function-use dest
-						     (template-type template)))
-			(return t)))))))
+		      (when (eq (template-policy template) :fast-safe)
+			(multiple-value-bind
+			    (val win)
+			    (valid-function-use dest (template-type template))
+			  (when (or val (not win)) (return t)))))))))
 	  (t t))))
 
 
-- 
GitLab