VALUES type specifier incorrectly accepts *

Bug #736418 reported by Jean-Philippe Paradis
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
SBCL
Fix Released
Low
Unassigned

Bug Description

What I do:
(the (values *) 'anything) => ANYTHING

What happens:
No condition of any kind is signaled.

What I expected to happen:
From CLHS for Type Specifier VALUES:

"The symbol * may not be among the value-types."

So I think signaling an error at compile-time would be appropriate and convenient. This may or may not break unknowingly faulty code out there?...

By the way, I'm aware that this is in the realm of "undefined behavior", not the realm of "the standard says an error must be signaled".

SBCL version: 1.0.42
uname -a: Linux dynamorph 2.6.32-29-generic #58-Ubuntu SMP Fri Feb 11 19:00:09 UTC 2011 i686 GNU/Linux

*features*:
(:SWANK :QUICKLISP :SB-BSD-SOCKETS-ADDRINFO :ASDF2 :ASDF :ANSI-CL :COMMON-LISP
 :SBCL :SB-DOC :SB-TEST :SB-LDB :SB-PACKAGE-LOCKS :SB-UNICODE :SB-EVAL
 :SB-SOURCE-LOCATIONS :IEEE-FLOATING-POINT :X86 :UNIX :ELF :LINUX :SB-THREAD
 :LARGEFILE :GENCGC :STACK-GROWS-DOWNWARD-NOT-UPWARD :C-STACK-IS-CONTROL-STACK
 :COMPARE-AND-SWAP-VOPS :UNWIND-TO-FRAME-AND-CALL-VOP :RAW-INSTANCE-INIT-VOPS
 :STACK-ALLOCATABLE-CLOSURES :STACK-ALLOCATABLE-VECTORS
 :STACK-ALLOCATABLE-LISTS :STACK-ALLOCATABLE-FIXED-OBJECTS :ALIEN-CALLBACKS
 :CYCLE-COUNTER :INLINE-CONSTANTS :MEMORY-BARRIER-VOPS :LINKAGE-TABLE
 :OS-PROVIDES-DLOPEN :OS-PROVIDES-PUTWC :OS-PROVIDES-SUSECONDS-T)

Tags: ansi review types
Changed in sbcl:
importance: Undecided → Low
status: New → Triaged
tags: added: ansi types
Changed in sbcl:
assignee: nobody → Roman Marynchak (roman-marynchak)
status: Triaged → In Progress
Revision history for this message
Roman Marynchak (roman-marynchak) wrote :

I consider this patch to be a KLUDGE, because the right solution is to prohibit * as a type specifier. However, this involves more issues to be fixed first:

1. (the * 6) -> 6, wrong.
2. (subtypep '* 't) is confused: "VALUES type illegal in this context".
3. sb-kernel::valid-type-specifier-p recognizes * to be a type specifier.

and maybe more?

As for now, let us fix the original issue, and then we should discuss the remaining ones.

tags: added: review
Changed in sbcl:
assignee: Roman Marynchak (roman-marynchak) → nobody
status: In Progress → Confirmed
Stas Boukarev (stassats)
Changed in sbcl:
status: Confirmed → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.