From 7e32788a2928a09e4f33a4eb5e843e09e18a1eb0 Mon Sep 17 00:00:00 2001 From: Common Lisp at Google Date: Wed, 3 Dec 2025 09:25:24 -0800 Subject: [PATCH] Require a stronger condition than simply not being not declaimed inline Reliably mocking needs NOTINLINE because functions within a file can be assumed to refer to one another unless the compiler is instructed not to assume that. PiperOrigin-RevId: 839787615 --- test.lisp | 3 +++ 1 file changed, 3 insertions(+) diff --git a/test.lisp b/test.lisp index 246d8eb..f32e9e3 100644 --- a/test.lisp +++ b/test.lisp @@ -283,6 +283,9 @@ the code and to provide test hooks or proper test interfaces." #+sbcl (defun call-with-mocks (thunk names &rest wrappers) (sb-int:aver (= (length wrappers) (length names))) + (dolist (name names) + (unless (eq (sb-int:info :function :inlinep name) 'notinline) + (error "~/sb-ext:print-symbol-with-prefix/ should be DECLAIMed notinline" name))) (with-recursive-lock-held (*unsafe-code-test-mutex*) (unwind-protect (progn