Ticket #803 (closed defect: fixed)

Opened 14 months ago

Last modified 8 months ago

setters like set-cdr! don't invalidate type information

Reported by: sjamaan Owned by:
Priority: major Milestone: 4.9.0
Component: compiler Version: 4.7.x
Keywords: scrutinizer, optimizations Cc:

Description

The following program, when compiled with specialization, prints {{#t}}. It prints #f in all other cases:

(let ((x (list 'a)))
  (set-cdr! x x)
  (print (list? x)))

If possible, set-car! and set-cdr! should have roughly the same effect as set! (and so should vector-set! but I couldn't reproduce a similar error with that, so I guess that's already taken care of, somehow)

I'll look into it in more detail but wanted to create a ticket so we don't forget about this.

Attachments

0001-when-calling-a-possibly-mutatiing-procedure-invalid.patch (1.9 kB) - added by felix 13 months ago.
patch submitted to chicken-hackers

Change History

Changed 13 months ago by felix

It looks like smash-component-types! needs not only to smash components but also change list and list-of types to (pair ...), since set-cdr! may convert a proper list into an improper one.

Changed 13 months ago by felix

patch submitted to chicken-hackers

Changed 13 months ago by sjamaan

  • status changed from new to closed
  • resolution set to fixed

This patch fixes it

Changed 8 months ago by felix

  • milestone changed from 4.8.0 to 4.9.0

Milestone 4.8.0 deleted

Note: See TracTickets for help on using tickets.