fix inlining default params issue

This commit is contained in:
2026-02-21 17:03:00 -06:00
parent 2ac446f7cf
commit cc7fc6b667
2 changed files with 119 additions and 0 deletions

View File

@@ -2809,7 +2809,19 @@ var streamline = function(ir, log) {
cont_label = label_prefix + "cont"
// Build inlined body with remapping
// Unmapped params (e.g. caller passes 1 arg to a 2-param function)
// must be explicitly nulled. compress_slots may merge the fresh
// slot (base+j) with a previously-live slot that holds a non-null
// value, so the default-param jump_not_null preamble would skip
// the default assignment and use a stale value instead.
inlined_body = []
j = 0
while (j <= callee_func.nr_args) {
if (!(j < length(arg_slots) && arg_slots[j] >= 0)) {
inlined_body[] = ["null", remap[j], 0, 0]
}
j = j + 1
}
k = 0
while (k < length(callee_func.instructions)) {
cinstr = callee_func.instructions[k]