From 3e71e980c611ac9f00565564bd1e647194f74321 Mon Sep 17 00:00:00 2001 From: zinc Date: Wed, 14 Oct 2026 16:07:12 +0330 Subject: closures: allow 24 parameters, like functions (was 19) --- src/compiler/expr.zc | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src/compiler') diff --git a/src/compiler/expr.zc b/src/compiler/expr.zc index 3d63e4b..c8cb11a 100644 --- a/src/compiler/expr.zc +++ b/src/compiler/expr.zc @@ -647,7 +647,7 @@ word closure_layout(int closure_index, int count) { // variable in. ctx_push / ctx_pop save and restore the enclosing function's // compiler state around the body. int closure() { - int np = 0; char*[20] pn; word[20] pty; int hop, entry, i, t, envl, ncap, c, result, declared = 0, tags = 0, tag, lt, lfl = tline; word[20] ptags; + int np = 0; char*[24] pn; word[24] pty; int hop, entry, i, t, envl, ncap, c, result, declared = 0, tags = 0, tag, lt, lfl = tline; word[24] ptags; word expected = closure_expected; closure_expected = 0; reserve_closures(nclo + 1); if (o3on) serr("closures can't be made inside an o3 region"); @@ -668,8 +668,8 @@ int closure() { if (expected && expected[0] == TY_FN && !tag && (isptr(pty[np]) || pty[np][0] == TY_DYN || pty[np][0] == TY_FN)) ptags[np] = 1; pnoffs[np] = toff; pnplaces[np] = tpack(); rs_note(RS_PARAM, toff); pn[np] = name(); np++; - if (np >= 20) { die("too many parameters"); break; } if (!accept(s_comma)) break; + if (np >= 24) { die("too many parameters"); break; } // 24, like a function } } expect(s_rp); -- cgit v1.2.3