Opened 9 years ago

Closed 9 years ago

Last modified 9 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 9 years ago.
patch submitted to chicken-hackers

Download all attachments as: .zip

Change History (4)

comment:1 Changed 9 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 9 years ago by felix winkelmann

patch submitted to chicken-hackers

comment:2 Changed 9 years ago by sjamaan

Resolution: fixed
Status: newclosed

This patch fixes it

comment:3 Changed 9 years ago by felix winkelmann

Milestone: 4.8.04.9.0

Milestone 4.8.0 deleted

Note: See TracTickets for help on using tickets.