byte function compilation is broken

Bug #2033695 reported by Patrick Dussud
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
SBCL
Fix Released
Undecided
Unassigned

Bug Description

on version 2.3.2 the following test executes without error but it throws an exception on 2.3.7 and 2.3.8
(declaim (optimize (safety 3)))
(defun test-byte()
  (let* ((pos 3/8))
    (flet ((int1 (value)
             (let ((octet 0))
               (setf (ldb (byte 1 (* 8 (rem pos 1))) octet) value)
               (incf pos 1/8)
               )))
      (int1 0))))

* (test-byte)

debugger invoked on a TYPE-ERROR @22545448 in thread
#<THREAD "main thread" RUNNING {10010B8113}>:
  The value
    3
  is not of type
    (MOD 4611686018427387841)

This is distilled from the code of :dns-client system which is non functional anymore

This is running from a Windows 11 machine.

Revision history for this message
Stas Boukarev (stassats) wrote :

Can't reproduce.

Changed in sbcl:
status: New → Incomplete
Revision history for this message
Stas Boukarev (stassats) wrote :

I can reproduce the error in dns-client, though.

Changed in sbcl:
status: Incomplete → Confirmed
Stas Boukarev (stassats)
Changed in sbcl:
status: Confirmed → Fix Committed
Revision history for this message
Patrick Dussud (phdussud) wrote :

The code didn't repro because the optimizer just produced the result of the execution of the code.
Adding the following line
(declare (optimize (safety 3) (speed 0)))
after the (defun test-byte() line makes the issue repro

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.