diff --git a/App/lib/core/Gen/Generator.vp b/App/lib/core/Gen/Generator.vp index 47c74a6..8708d23 100644 --- a/App/lib/core/Gen/Generator.vp +++ b/App/lib/core/Gen/Generator.vp @@ -180,6 +180,30 @@ class Generator(BaseGenMixin.BaseGenMixin, TypeGenMixin.TypeGenMixin, self.VtMethodNames = None self.VtParentSha1s = None self.VtMethodCount = 0 + # ---- ClassGenBase 补漏字段(阶段 D 拆分新增,此前未初始化: + # 结构体是 malloc 分配,未初始化字段是内存垃圾——非 null 垃圾 + # 指针能通过 `is not None` 检查,导致 is_exception_name 等查询 + # 直接 strcmp 越界崩溃;int 垃圾则导致循环次数失控) ---- + self.RenumAliasTy = None + self.RenumAliasVariant = None + self.ClassMetaKinds = None + self.ClassMetaClss = None + self.ClassMetaFields = None + self.ClassMetaCount = 0 + self.DecoratorFuncCount = 0 + self.DecoratorFuncNames = None + self.DecoratorWrapNames = None + self.DecoratorArgs = None + # 异常类注册表(_ensure_exception_tables 仍保留懒分配,但 + # ExceptionNames 必须初始化为 null——否则 `is not None` 误判垃圾 + # 指针为已初始化,跳过分配直接查表 → strcmp 越界) + self.ExceptionCount = 0 + self.ExceptionNames = None + self.ExceptionParents = None + self.ExceptionCodes = None + self.NextExceptionCode = 0 + self._exception_codes_tmp_count = 0 + self.GenericSpecDepth = 0 # ---- ImportsGenMixin 字段 ---- self.ReexportSha1s = None self.ReexportFuncs = None