Keyword argument checking and apply

Bug #1750466 reported by Eric Timmons on 2018-02-19
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
SBCL
Undecided
Unassigned

Bug Description

Compiling a file with the following function results in the note below.

(defun test-fun ()
  (apply 'find '(3 (1 2 3) :from-end t)))

; in: DEFUN TEST-FUN
; (APPLY 'FIND '(3 (1 2 3) :FROM-END T))
; --> MULTIPLE-VALUE-CALL
; ==>
; (SB-C::%FUNCALL #'FIND #:G2 #:G3 #:G4 #:G5)
;
; note: The third argument (in keyword position) is not a constant, weakening keyword
; argument checking.

It's a very unintuitive note because as the programmer's written it, :from-end is definitely a constant. Additionally, some macros like alexandria:removef and uiop:define-package (prior to 3.3.1.4 at least) use apply in this way and can end up generating enough notes in code that uses them a lot to drown out real issues.

sbcl --version:
SBCL 1.4.4

uname -a:
Linux rocinante 4.14.19-gentoo #1 SMP Fri Feb 16 20:35:41 EST 2018 x86_64 Intel(R) Core(TM) i7-7700HQ CPU @ 2.80GHz GenuineIntel GNU/Linux

*features*:
(ALEXANDRIA.0.DEV::SEQUENCE-EMPTYP :THREAD-SUPPORT :SWANK :QUICKLISP
 :SB-BSD-SOCKETS-ADDRINFO :ASDF3.3 :ASDF-PACKAGE-SYSTEM :ASDF3.2 :ASDF3.1
 :ASDF3 :ASDF2 :ASDF :OS-UNIX :NON-BASE-CHARS-EXIST-P :ASDF-UNICODE :64-BIT
 :64-BIT-REGISTERS :ALIEN-CALLBACKS :ANSI-CL :ASH-RIGHT-VOPS
 :C-STACK-IS-CONTROL-STACK :COMMON-LISP :COMPACT-INSTANCE-HEADER
 :COMPARE-AND-SWAP-VOPS :COMPLEX-FLOAT-VOPS :CYCLE-COUNTER :ELF :FLOAT-EQL-VOPS
 :FP-AND-PC-STANDARD-SAVE :GCC-TLS :GENCGC :IEEE-FLOATING-POINT :IMMOBILE-CODE
 :IMMOBILE-SPACE :INLINE-CONSTANTS :INTEGER-EQL-VOP :LARGEFILE :LINKAGE-TABLE
 :LINUX :LITTLE-ENDIAN :MEMORY-BARRIER-VOPS :MULTIPLY-HIGH-VOPS
 :OS-PROVIDES-BLKSIZE-T :OS-PROVIDES-DLADDR :OS-PROVIDES-DLOPEN
 :OS-PROVIDES-GETPROTOBY-R :OS-PROVIDES-POLL :OS-PROVIDES-PUTWC
 :OS-PROVIDES-SUSECONDS-T :PACKAGE-LOCAL-NICKNAMES :RAW-INSTANCE-INIT-VOPS
 :RAW-SIGNED-WORD :RELOCATABLE-HEAP :SB-CORE-COMPRESSION :SB-DOC :SB-EVAL
 :SB-FUTEX :SB-LDB :SB-PACKAGE-LOCKS :SB-SIMD-PACK :SB-SOURCE-LOCATIONS
 :SB-THREAD :SB-UNICODE :SB-XREF-FOR-INTERNALS :SBCL
 :STACK-ALLOCATABLE-CLOSURES :STACK-ALLOCATABLE-FIXED-OBJECTS
 :STACK-ALLOCATABLE-LISTS :STACK-ALLOCATABLE-VECTORS
 :STACK-GROWS-DOWNWARD-NOT-UPWARD :SYMBOL-INFO-VOPS :UNBIND-N-VOP
 :UNDEFINED-FUN-RESTARTS :UNIX :UNWIND-TO-FRAME-AND-CALL-VOP :X86-64)

Stas Boukarev (stassats) wrote :

2cfa0e5b06b2e1093a629760d0ebda6bcd3c6c68

Changed in sbcl:
status: New → Fix Committed
Changed in sbcl:
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Other bug subscribers