aboutsummaryrefslogtreecommitdiff
path: root/src/lib/actor.zc
diff options
context:
space:
mode:
authorGravatar zinc <zinc@downsta.ir> 2026-10-15 22:15:38 +0330
committerGravatar zinc <zinc@downsta.ir> 2026-10-15 22:15:38 +0330
commitbe43babc1886fc5efee898b2a3d0285012e511fb (patch)
treeb7ae73e7a6d4c896e2c49b7090168ef589b574af /src/lib/actor.zc
parentmerge 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/lib/actor.zc')
-rw-r--r--src/lib/actor.zc2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/lib/actor.zc b/src/lib/actor.zc
index c013441..d0c0f10 100644
--- a/src/lib/actor.zc
+++ b/src/lib/actor.zc
@@ -121,7 +121,7 @@ unchecked int write_message(int fd, word address, word type) {
rt.free(refs); rt.free(data); return result;
}
unchecked int read_message(int fd, word address, word type) {
- int count = 0; word data, refs, frame[2];
+ int count = 0; word data, refs, frame[2] = {};
if (rt.syscall(45, fd, &count, 1) < 0 || count < 0 || count > 1048576) return -1;
data = rt.dnew(1, count, 0); refs = vector(); frame[0] = data; frame[1] = 0;
if (rt.syscall(45, fd, data[2], count) < 0) { rt.free(refs); rt.free(data); return -1; }