fix: 全量单测修复(flatten 健壮性 + 测试链路补 flatten + 断言对齐规范)
This commit is contained in:
@@ -23,7 +23,8 @@ fn assign_ids(module: &mut CompiledModule, next_id: &mut u32) {
|
||||
for instr in &mut module.bytecode {
|
||||
if opcode::opcode(*instr) == OpCode::CREATE_CLOSURE {
|
||||
let rel = opcode::imm16(*instr) as usize;
|
||||
let flat = module.sub_modules.get(rel - 1).map(|s| s.flat_id).unwrap_or(0);
|
||||
// rel 应为 1-based 子模块下标;0 表示无引用(异常输入),按未解析处理。
|
||||
let flat = if rel > 0 { module.sub_modules.get(rel - 1).map(|s| s.flat_id).unwrap_or(0) } else { 0 };
|
||||
let rd = opcode::rd(*instr);
|
||||
*instr = opcode::encode(
|
||||
OpCode::CREATE_CLOSURE,
|
||||
|
||||
Reference in New Issue
Block a user