From 985983391b4b7609f0925a19620eaa229d53f829 Mon Sep 17 00:00:00 2001 From: TermiNexus Date: Sun, 11 Oct 2026 10:04:19 +0800 Subject: [PATCH] =?UTF-8?q?fix(narrow):=20ClassGenBase=20=E6=96=B9?= =?UTF-8?q?=E6=B3=95=E5=85=83=E6=95=B0=E6=8D=AE=E6=8C=87=E9=92=88=E5=A3=B0?= =?UTF-8?q?=E6=98=8E=20int*=20=E8=80=8C=E9=9D=9E=20t.CPtr?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit flags_ptr/flags_ptr2 被显式 (int*)(...) 赋值但声明为 t.CPtr,下标元素被判为 i8,与 i*4 的 32 位步长及位标志语义不符(且 >127 的值会读出符号错误);声明改为 int* --- App/lib/core/Gen/Class/ClassGenBase.vp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/App/lib/core/Gen/Class/ClassGenBase.vp b/App/lib/core/Gen/Class/ClassGenBase.vp index 43741c7..9f06d08 100644 --- a/App/lib/core/Gen/Class/ClassGenBase.vp +++ b/App/lib/core/Gen/Class/ClassGenBase.vp @@ -631,7 +631,7 @@ novirtual class ClassGenBase: i: int for i in range(self.MethodMetaCount): if string.strcmp(self.MethodMetaKeys + i * META_KEY_LEN, key_buf) == 0: - flags_ptr: t.CPtr = (int*)(uint64(self.MethodMetaFlags) + i * 4) + flags_ptr: int* = (int*)(uint64(self.MethodMetaFlags) + i * 4) # OR-combine flags: a getter then setter/deleter registers repeatedly, # so whole-value replacement would drop GETTER and crash downstream mlirlite. flags_ptr[0] = flags_ptr[0] | meta @@ -640,7 +640,7 @@ novirtual class ClassGenBase: if self.MethodMetaCount < META_MAX: # Slot is META_KEY_LEN=128 bytes; clamp strncpy to avoid overflowing the next slot. string.strncpy(self.MethodMetaKeys + self.MethodMetaCount * META_KEY_LEN, key_buf, META_KEY_LEN - 1) - flags_ptr2: t.CPtr = (int*)(uint64(self.MethodMetaFlags) + self.MethodMetaCount * 4) + flags_ptr2: int* = (int*)(uint64(self.MethodMetaFlags) + self.MethodMetaCount * 4) flags_ptr2[0] = meta self.MethodMetaCount += 1 stdlib.free(key_buf) @@ -657,7 +657,7 @@ novirtual class ClassGenBase: i: int for i in range(self.MethodMetaCount): if string.strcmp(self.MethodMetaKeys + i * META_KEY_LEN, key_buf) == 0: - flags_ptr: t.CPtr = (int*)(uint64(self.MethodMetaFlags) + i * 4) + flags_ptr: int* = (int*)(uint64(self.MethodMetaFlags) + i * 4) found = flags_ptr[0] break stdlib.free(key_buf)