stage1 支持函数指针

This commit is contained in:
zzy committed 2026-09-17 20:13:24 +08:00
1 parent 73c9a40abd
commit 70ac7380e9
4 files changed
+36 -1

No files matched your search

+4
View File
@@ -1182,6 +1182,10 @@ int spl_ir2vm_run(spl_ir2vm_t *ctx) {
}
}
/* 保留 insn 0 作为哨兵:确保真实函数入口地址非零,
从而 0 可唯一表示 null 函数指针(函数指针与 null 比较)。 */
spl_prog_add_instr(&ctx->prog, SPL_HALT, SPL_VOID, 0);
/* Pass 2:翻译非 extern 的函数 */
usize *fid_ip = calloc(n, sizeof(usize));
fix_vec_t all_fixups;