stage1 修复错误 提供类型检查
This commit is contained in:
@@ -90,8 +90,14 @@ static int parse_fn_body(spl_comp_t *ctx, const char *fn_name, int ret_type_idx,
|
||||
if ((usize)ctx->emit.frame.peak_bytes < min_bytes)
|
||||
ctx->emit.frame.peak_bytes = (int)min_bytes;
|
||||
}
|
||||
emit_patch(&ctx->emit, alloc_addr,
|
||||
ctx->emit.frame.peak_bytes / (int)sizeof(spl_val_t) - total_phys_slots);
|
||||
int alloc_slots = ctx->emit.frame.peak_bytes / (int)sizeof(spl_val_t) - total_phys_slots;
|
||||
if (alloc_slots < 0 || alloc_slots > 65536) {
|
||||
fprintf(
|
||||
stderr,
|
||||
"WARN: parse_fn_body: suspicious alloc_slots=%d (peak_bytes=%d, phys_slots=%d)\n",
|
||||
alloc_slots, ctx->emit.frame.peak_bytes, total_phys_slots);
|
||||
}
|
||||
emit_patch(&ctx->emit, alloc_addr, alloc_slots);
|
||||
expect(ctx, TOK_R_BRACE);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user