hare

[hare] The Hare programming language
git clone https://git.torresjrjr.com/hare.git
Log | Files | Refs | README | LICENSE

commit 06797ee67a09f341f4bc6991d2717c00614838bf
parent 002c60ab88bbb815f59234790b81f89ff3c78f8b
Author: Armin Preiml <apreiml@strohwolke.at>
Date:   Fri, 24 Feb 2023 16:37:29 +0100

io::copy_fallback: use non static buffer

A data race can happen when using io::copy on a stream that also uses
io::copy internally.

Signed-off-by: Armin Preiml <apreiml@strohwolke.at>

Diffstat:
Mio/copy.ha | 2+-
1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/io/copy.ha b/io/copy.ha @@ -50,7 +50,7 @@ fn copy_streams(dest: *stream, src: *stream) (error | size) = { fn copy_fallback(dest: handle, src: handle) (error | size) = { let w = 0z; - static let buf: [4096]u8 = [0...]; + let buf: [4096]u8 = [0...]; for (true) { match (read(src, buf[..])?) { case let n: size =>