Error while parsing arguments to DESTRUCTURING-BIND during compile

Bug #2003289 reported by Paul F. Dietz
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
SBCL
Fix Released
Undecided
Unassigned

Bug Description

(lambda (b)
  (declare (notinline + find <=))
  (loop for lv2 below 2
        count (and (<= 0 0 0) (find (+ b) #(-32757854765) :test '<=))))

==>

Error while parsing arguments to DESTRUCTURING-BIND:
  too many elements in
    (#<SB-C::LVAR 1 {10360CD3E3}> #<SB-C::LVAR 2 {10360CD533}>
     #<SB-C::LVAR 3 {10360CD623}>)
  to satisfy lambda list
    (A2 B2):
  exactly 2 expected, but got 3
   [Condition of type SB-KERNEL::ARG-COUNT-ERROR]

[...]
Backtrace:
  0: (SB-C::CHECK-DS-LIST #<unavailable argument> #<unavailable argument> #<unavailable argument> #<unavailable argument>)
  1: ((FLET SB-C::TRY :IN SB-C::RANGE-TRANSFORM) NIL)
  2: ((LABELS SB-C::TRY :IN SB-C::RANGE-TRANSFORM) #<SB-C::CBLOCK 8 :START c4 {10360CC563}> #<SB-C::CBLOCK 4 :START c5 {10360CC223}>)
  3: (SB-C::IR1-OPTIMIZE-COMBINATION #<SB-C::COMBINATION :FUN #<SB-C::REF :LEAF #<SB-C::GLOBAL-VAR :%SOURCE-NAME >= :TYPE #1=#<SB-KERNEL:FUN-TYPE #> :DEFINED-TYPE #1# :WHERE-FROM :DECLARED :KIND :GLOBAL-F..
  4: (SB-C::IR1-OPTIMIZE #<SB-C:COMPONENT :NAME "<unknown>" {10360D0593}> NIL)
  5: (SB-C::IR1-OPTIMIZE-UNTIL-DONE #<SB-C:COMPONENT :NAME "<unknown>" {10360D0593}>)
  6: (SB-C::IR1-OPTIMIZE-PHASE-1 #<SB-C:COMPONENT :NAME "<unknown>" {10360D0593}>)
  7: (SB-C::IR1-PHASES #<SB-C:COMPONENT :NAME "<unknown>" {10360D0593}>)
  8: (SB-C::COMPILE-COMPONENT #<SB-C:COMPONENT :NAME "<unknown>" {10360D0593}>)
[...]

x86-64, "2.3.0.177-df6846ef1"

Revision history for this message
Paul F. Dietz (paul-f-dietz) wrote :

(locally (declare (notinline > lcm +)) (lcm (+ 0) (loop for x below 2 count (> 0)))) also gives a similar error, this time with just 1 instead of 2. It looks like destructuring bind is assuming the comparison operators have exactly two args, and notinline is messing this up.

Stas Boukarev (stassats)
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  
Everyone can see this information.

Other bug subscribers

Remote bug watches

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