Clojure

crafted `vec' call allows created vector to be mutated

Details

  • Type: Defect Defect
  • Status: Closed Closed
  • Priority: Major Major
  • Resolution: Completed
  • Affects Version/s: Release 1.3, Release 1.4
  • Fix Version/s: Release 1.5
  • Component/s: None
  • Labels:
    None
  • Environment:
    Found in 1.3.0; tested in 1.4.0-alpha2 as well.
  • Patch:
    Code
  • Approval:
    Ok

Description

user> (let [a (to-array (repeat 31 0)), v (vec a)]
        [(v 2) (do (aset a 2 'no) (v 2))])
[0 no]
user> (let [a (to-array (repeat 33 0)), v (vec a)]
        [(v 2) (do (aset a 2 'no) (v 2))])
[0 0]

While a relaxation of when different changes to the environment are made may impact the resulting value of the vector, as it is with lazy seqs, it oughtn't be possible to get two different results for the same access, just as with lazy seqs.

Activity

Stuart Halloway made changes -
Field Original Value New Value
Approval Vetted [ 10003 ]
Fix Version/s Approved Backlog [ 10034 ]
Andy Fingerhut made changes -
Attachment clj-893-doc-vec-aliases-java-array-patch.txt [ 10965 ]
Andy Fingerhut made changes -
Patch Code [ 10001 ]
Stuart Sierra made changes -
Approval Vetted [ 10003 ] Incomplete [ 10006 ]
Andy Fingerhut made changes -
Attachment clj-893-doc-vec-aliases-java-array-patch2.txt [ 11011 ]
Andy Fingerhut made changes -
Attachment clj-893-doc-vec-aliases-java-array-patch.txt [ 10965 ]
Rich Hickey made changes -
Fix Version/s Approved Backlog [ 10034 ]
Fix Version/s Release 1.5 [ 10150 ]
Brenton Ashworth made changes -
Brenton Ashworth made changes -
Approval Incomplete [ 10006 ] Screened [ 10004 ]
Andy Fingerhut made changes -
Attachment clj-893-doc-vec-aliases-java-array-patch2.txt [ 11011 ]
Rich Hickey made changes -
Approval Screened [ 10004 ] Ok [ 10007 ]
Stuart Halloway made changes -
Resolution Completed [ 1 ]
Status Open [ 1 ] Closed [ 6 ]

People

Vote (1)
Watch (1)

Dates

  • Created:
    Updated:
    Resolved: