From c306ef39eeb7e06d52596f352d9c8a9ee0b3d2da Mon Sep 17 00:00:00 2001 From: jacopodl Date: Tue, 16 Jan 2024 17:04:32 +0100 Subject: [PATCH] fix: correct an error preventing the creation of unfrozen Bytes objects in certain cases --- argon/vm/datatype/bufview.cpp | 1 + argon/vm/datatype/bufview.h | 1 + 2 files changed, 2 insertions(+) diff --git a/argon/vm/datatype/bufview.cpp b/argon/vm/datatype/bufview.cpp index 652d708d..f5726585 100644 --- a/argon/vm/datatype/bufview.cpp +++ b/argon/vm/datatype/bufview.cpp @@ -15,6 +15,7 @@ SharedBuffer *SharedBufferNew(ArSize cap, bool frozen) { if (shared != nullptr) { shared->counter = 1; + shared->flags = SharedBufferFlags::NONE; if (frozen) shared->flags = SharedBufferFlags::FROZEN; diff --git a/argon/vm/datatype/bufview.h b/argon/vm/datatype/bufview.h index 2a2bd8c5..53383db5 100644 --- a/argon/vm/datatype/bufview.h +++ b/argon/vm/datatype/bufview.h @@ -14,6 +14,7 @@ namespace argon::vm::datatype { enum class SharedBufferFlags : unsigned int { + NONE, FROZEN };