feat(memhub): [DET] 越界写追加记录表上下文 - 打印越界块前后各3条 {ptr,size},推断分配阶段(如 lexer/parser 小结构),配合越界区数据定位 size=7 块写入者

This commit is contained in:
TermiNexus committed 2026-08-25 15:53:44 +08:00
1 parent 878840a081
commit d3a84c25e0
1 file changed
+10
+10
View File
@@ -898,6 +898,16 @@ class MemBuddy(MemManager):
bvj: t.CUInt8T = (t.CUInt8T | t.CPtr)(t.CVoid(p + s + t.CUInt64T(bj3), t.CPtr))[0]
stdio.printf("%02X ", t.CUInt32T(bvj))
bj3 += 1
# 记录表上下文:该条前 3 + 后 3 的 {ptr,size},推断越界块分配阶段
stdio.printf("\n记录上下文: ")
ci2: t.CInt = -3
while ci2 <= 3:
idx2: t.CSizeT = t.CSizeT(t.CInt(i) + ci2)
if idx2 < self._det_count:
cip: t.CUInt64T = self._det_records[idx2 * 2]
cis: t.CUInt64T = self._det_records[idx2 * 2 + 1]
stdio.printf("[%d]ptr=%llu sz=%llu ", ci2, cip, cis & (free_flag - 1))
ci2 += 1
stdio.printf("\n")
stdlib.exit(1)
i += 1