diff options
| author | 2026-10-14 20:46:17 +0330 | |
|---|---|---|
| committer | 2026-10-14 20:46:17 +0330 | |
| commit | 900c59c4d72c692e0bb8e0d3a28cc52547e58c9b (patch) | |
| tree | 3b4508ef6d4b639687122c5b3753300cdc97ada0 /src/compiler/stmt.zc | |
| parent | detach doc comments on internal bounds helpers (genome size); todo: reuse cap... (diff) | |
wip: prover gaps (inline len bound, cross-array, rt.new depth, fixed new, affine i*n+k); unbuilt and untestedwork/prover
Diffstat (limited to 'src/compiler/stmt.zc')
| -rw-r--r-- | src/compiler/stmt.zc | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/src/compiler/stmt.zc b/src/compiler/stmt.zc index d23cb52..067820b 100644 --- a/src/compiler/stmt.zc +++ b/src/compiler/stmt.zc @@ -327,7 +327,7 @@ int kw_for() { // i < n with a variable n: a jump to the loop entry, where hoisted checks get their flags (see hoist_guard) if (fbnd && infn && !dry && tk == T_ID) { peekat(1); if (pk_tk == T_ID) { peek(); if (pk_tk == T_OP && pk_tv == s_lt) { xe = hole(); op(O_JMP); } } } c0 = here; - ft_iv = -1; ft_ck = -1; fs_ok = 0; fortest = 1; + ft_iv = -1; ft_ck = -1; ft_ln = -1; fs_ok = 0; fortest = 1; if (!is_op(s_semi)) { if (tk == T_NUM && tv) { peek(); if (pk_tk == T_OP && pk_tv == s_semi) inf = 1; } c = borrow_condition(); @@ -357,6 +357,8 @@ int kw_for() { } if (cl && ft_bd >= 0 && getlo(ft_iv) >= 0 && getln(ft_bd) >= 0) { if (!ldirty(r, lname[getln(ft_bd)]) && lclean(getln(ft_bd))) lpfact[lsp - 1] = pfact(ft_iv, ft_bd, getln(ft_bd)); + } else if (cl && ft_bd < 0 && ft_ln >= 0 && getlo(ft_iv) >= 0) { // i < len(a) written in the test + if (!ldirty(r, lname[ft_ln]) && lclean(ft_ln)) lpfact[lsp - 1] = pfact(ft_iv, 0 - 3, ft_ln); } else if (cl && ft_ck >= 0 && getlo(ft_iv) >= 0) { // i < constant: proves a fixed array that long lpfact[lsp - 1] = pfact(ft_iv, -1, 0 - ft_ck - 2); } else if (cl && xe >= 0 && ft_bd >= 0 && ltype[ft_iv] == tint && ltype[ft_bd] == tint) { r[52] = 1; r[41] = ft_bd; } // i < n: checks against n can be hoisted |
