mirror of
https://github.com/carp-lang/Carp.git
synced 2024-09-19 01:18:40 +03:00
Critical bug found ("stack-use-after-scope").
This commit is contained in:
parent
20a98ba617
commit
745a47cd70
@ -8,6 +8,7 @@
|
||||
## Critical Bugs
|
||||
* [0.3] References must keep track of their origin and prevent usage of them if the origin has been given away.
|
||||
* [0.3] Initilization of globals must happen in correct order.
|
||||
* [0.3] Can set a ref so it points to a value in a more short-lived scope, leads to 'stack-use-after-scope' error in clang-sanitizer.
|
||||
|
||||
## Big Language Features
|
||||
* [0.3] The array should use a more efficient re-allocation scheme, a la http://en.cppreference.com/w/cpp/container/vector
|
||||
|
@ -30,15 +30,6 @@
|
||||
;; (do (String.delete s)
|
||||
;; (IO.println r))))
|
||||
|
||||
;; Using the (Fn (String String) Bool) version of '=' can lead to memory error?
|
||||
;; It takes ownership over the strings but while fails to detect the double use.
|
||||
(defn main []
|
||||
(let [s @"hej"]
|
||||
(while (/= s @"svej")
|
||||
(do
|
||||
;;(String.delete s)
|
||||
(set! s @"svej")))))
|
||||
|
||||
;; ;; This crashes the compiler:
|
||||
;; (defn x [a] (the Inthdfdf a))
|
||||
|
||||
@ -47,3 +38,10 @@
|
||||
;; (let [s @"hej"]
|
||||
;; (do (delete s)
|
||||
;; s)))
|
||||
|
||||
;; Setting ref to value in short-lived scope
|
||||
(defn main []
|
||||
(let-do [r &[1 2 3]]
|
||||
(let [xs [4 5 6]]
|
||||
(set! r &xs))
|
||||
(println* r)))
|
||||
|
Loading…
Reference in New Issue
Block a user