Add UNDEFINED-ALIEN-FUNCTION-ERROR test for indirect calls

UNDEFINED-ALIEN-FUNCTION-ERROR should be able to report the undefined
function name's when ALIEN-FUNCALLing indirectly via
SB-SYS:FOREIGN-SYMBOL-ADDRESS which points to a linkage table
trampoline.
This commit is contained in:
Luís Borges de Oliveira 2021-06-09 10:58:37 +01:00 committed by Stas Boukarev
parent 50085a82c7
commit 316f4b7892

View file

@ -534,6 +534,17 @@
(assert (typep c 'sb-kernel::undefined-alien-function-error))
(assert (equal (cell-error-name c) "bar")))))
(with-test (:name :undefined-alien-name-via-linkage-table-trampoline
:skipped-on (not (or :x86-64 :arm :arm64)))
(handler-case (funcall (checked-compile
`(lambda ()
(with-alien ((fn (* (function (values)))
(sb-sys:int-sap (sb-sys:foreign-symbol-address "baz"))))
(alien-funcall fn)))))
(t (c)
(assert (typep c 'sb-kernel::undefined-alien-function-error))
(assert (equal (cell-error-name c) "baz")))))
(defconstant fleem 3)
;; We used to expand into
;; (SYMBOL-MACROLET ((FLEEM (SB-ALIEN-INTERNALS:%ALIEN-VALUE