#803 closed defect (fixed)
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: | |
| Estimated difficulty: |
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 (1)
Change History (4)
comment:1 Changed 14 years ago by
Changed 14 years ago by
| Attachment: | 0001-when-calling-a-possibly-mutatiing-procedure-invalid.patch added |
|---|
patch submitted to chicken-hackers
Note: See
TracTickets for help on using
tickets.

It looks like
smash-component-types!needs not only to smash components but also changelistandlist-oftypes to(pair ...), sinceset-cdr!may convert a proper list into an improper one.