mirror of
https://github.com/carp-lang/Carp.git
synced 2024-11-05 04:44:12 +03:00
Bug explanation.
This commit is contained in:
parent
3e98719ec2
commit
e288381a6d
@ -146,7 +146,20 @@
|
||||
;; (set! x 11)
|
||||
;; (println* x))))
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
;; The ref error is detected when the forms inside (= ...) are reversed.
|
||||
;; Right now the lifetime (that is shared by both arguments to =) becomes
|
||||
;; set to [111], which is alive for the rest of the scope.
|
||||
;; So the memory error inside (let ...) doesn't get detected since the
|
||||
;; lifetime is alive before, during, and after its scope.
|
||||
(defn f []
|
||||
(= $[1 2 4]
|
||||
(let [xs $[1 2 3]]
|
||||
xs)))
|
||||
(=
|
||||
&[111]
|
||||
(let [xs &[222]]
|
||||
xs)
|
||||
|
||||
))
|
||||
|
Loading…
Reference in New Issue
Block a user