From 5e855608d72d06f3a7bd03ea9271dffc791ad2ca Mon Sep 17 00:00:00 2001 From: Agent Smith Date: Wed, 2 Apr 2025 11:01:03 +0800 Subject: [PATCH] fix: a gc bug causing slice get collected early than expected --- immix | 2 +- src/ast/builder/llvmbuilder.rs | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/immix b/immix index 7311e359..439aff53 160000 --- a/immix +++ b/immix @@ -1 +1 @@ -Subproject commit 7311e3596c1be1cbf18fd021865ae66967867f9a +Subproject commit 439aff5395efa912316d9b20b60890cb6920e9a5 diff --git a/src/ast/builder/llvmbuilder.rs b/src/ast/builder/llvmbuilder.rs index 58502387..49197f55 100644 --- a/src/ast/builder/llvmbuilder.rs +++ b/src/ast/builder/llvmbuilder.rs @@ -594,7 +594,7 @@ impl<'a, 'ctx> LLVMBuilder<'a, 'ctx> { self.builder .build_memset( casted_result1, - 8, + 1, self.context.i8_type().const_zero(), arr_size, ) @@ -3553,7 +3553,7 @@ impl<'a, 'ctx> IRBuilder<'a, 'ctx> for LLVMBuilder<'a, 'ctx> { } else { to }; - self.builder.build_memcpy(to, 8, from, 8, arg_len).unwrap(); + self.builder.build_memcpy(to, 1, from, 1, arg_len).unwrap(); } fn build_bit_not(&self, v: ValueHandle) -> ValueHandle { let v = self.get_llvm_value(v).unwrap();