From fa52fbd4e5ebf09547c18cd5f9e083222747db6e Mon Sep 17 00:00:00 2001 From: TermiNexus Date: Wed, 19 Aug 2026 02:54:08 +0800 Subject: [PATCH] =?UTF-8?q?fix(gen):=20REnum=20=E5=8F=98=E4=BD=93=E6=A3=80?= =?UTF-8?q?=E6=B5=8B=E9=81=BF=E5=85=8D=E6=8C=87=E9=92=88=E5=87=8F=E6=B3=95?= =?UTF-8?q?=E7=94=9F=E6=88=90=E9=9D=9E=E6=B3=95=20sub=20i8*?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit rc_mq_dot - rc_mq_path 两操作数都是 str(i8*),TPC 直接发 sub i8*, i8* 非法 IR,opt ASan 插桩失败。改用 strlen 整数差计算模块前缀长度 (strlen(path) - strlen(cls) - 1),与既有 d_i - d_start 整数减法写法一致。 --- App/lib/core/Gen/CallGenMixin.vp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/App/lib/core/Gen/CallGenMixin.vp b/App/lib/core/Gen/CallGenMixin.vp index 59bbec0..61a3445 100644 --- a/App/lib/core/Gen/CallGenMixin.vp +++ b/App/lib/core/Gen/CallGenMixin.vp @@ -437,8 +437,10 @@ class CallGenMixin(CallGenBase.CallGenBase): if rc_mq_path is not None: rc_mq_dot: str = string.strrchr(rc_mq_path, 46) # 46 = ord('.') if rc_mq_dot is not None and rc_mq_dot[1] != '\0': - # 模块路径 = 末段之前(支持多级: w32.fileio.Class.Variant) - rc_mq_len: t.CSizeT = rc_mq_dot - rc_mq_path + # 模块路径 = 末段之前(支持多级: w32.fileio.Class.Variant)。 + # 注意:不能用 rc_mq_dot - rc_mq_path 指针减法(TPC 直接发 + # sub i8*, i8* 非法 IR),用 strlen 整数差扣除末段与分隔点。 + rc_mq_len: t.CSizeT = string.strlen(rc_mq_path) - string.strlen(rc_mq_dot + 1) - 1 rc_mq_mod: str = pool.alloc(rc_mq_len + 1) if rc_mq_mod is not None: string.memcpy(rc_mq_mod, rc_mq_path, rc_mq_len)