Opened 12 years ago

Closed 12 years ago

Last modified 11 years ago

#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)

0001-when-calling-a-possibly-mutatiing-procedure-invalid.patch (1.9 KB) - added by felix winkelmann 12 years ago.
patch submitted to chicken-hackers

Download all attachments as: .zip

Change History (4)

comment:1 Changed 12 years ago by felix winkelmann

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 12 years ago by felix winkelmann

patch submitted to chicken-hackers

comment:2 Changed 12 years ago by sjamaan

Resolution: fixed
Status: newclosed

This patch fixes it

comment:3 Changed 11 years ago by felix winkelmann

Milestone: 4.8.04.9.0

Milestone 4.8.0 deleted

Note: See TracTickets for help on using tickets.