diff options
| author | 2026-10-15 22:15:38 +0330 | |
|---|---|---|
| committer | 2026-10-15 22:15:38 +0330 | |
| commit | be43babc1886fc5efee898b2a3d0285012e511fb (patch) | |
| tree | b7ae73e7a6d4c896e2c49b7090168ef589b574af /src/lsp | |
| parent | merge work/known-bugs: constant-expression precedence, local const in constan... (diff) | |
definite assignment: reading a local before it is initialized is a compile error (spec 4.1.5, b.1.9)
track linited per local alongside the ownership state; snapshots, exit records and joins carry it, and a join keeps a local set only when every reaching path set it. x = e, a declaration initializer, &x (out-parameter), a full array initializer, or using an aggregate as an address set a local; field and element writes do not set the aggregate. while/for bodies that may run zero times do not count; do/while does. compiler, runtime, std, actor and lsp sources initialize the locals the rule flagged; zc0 accepts = {} brace lists (zeroed). tests: tests/errors/uninit_*.zc, tests/conformance/4-statements/uninit_*.zc
Diffstat (limited to 'src/lsp')
| -rw-r--r-- | src/lsp/server.zc | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/lsp/server.zc b/src/lsp/server.zc index 536d71c..79afb36 100644 --- a/src/lsp/server.zc +++ b/src/lsp/server.zc @@ -67,7 +67,7 @@ int ws(char* s) { } // writes n in decimal, with a minus sign when it is negative. int wn(int n) { - word[24] b; int i = 0; + word[24] b = {}; int i = 0; if (n < 0) { wc('-'); n = 0 - n; } while (1) { b[i] = '0' + n % 10; i++; n = n / 10; if (!n) break; } while (i) { i--; wc(b[i]); } |
