aboutsummaryrefslogtreecommitdiff
path: root/src/lib
diff options
context:
space:
mode:
authorGravatar zinc <zinc@downsta.ir> 2026-10-14 15:58:58 +0330
committerGravatar zinc <zinc@downsta.ir> 2026-10-14 15:58:58 +0330
commitd55b5fdf92a674a6495878f97a09e95bafdcba3f (patch)
treee811149b65640a3e253e6ebdce41affddb53ac37 /src/lib
parentmerge line tables (diff)
bounds checking: port agent/bounds-checking onto main 0879d0a; unbounded main in o3call, o3 tests expect no check, boundsrules, bounds_fixed, bounds_heap and zc0unbounded tests
Diffstat (limited to 'src/lib')
-rw-r--r--src/lib/actor.zc4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/lib/actor.zc b/src/lib/actor.zc
index 29fd600..a129f7f 100644
--- a/src/lib/actor.zc
+++ b/src/lib/actor.zc
@@ -53,11 +53,11 @@ unchecked int encode(word data, word refs, word address, word type) {
}
if (kind == 13) { n = rt.len_s(pointer); append(data, n); while (i < n) { append(data, rt.at_s(pointer, i)); i++; } return 0; }
if (kind == 7) {
- element = pointer[-1]; n = pointer[-5] - rt.HDR;
+ unbounded { element = pointer[-1]; n = pointer[-5] - rt.HDR; } // the object's header, on purpose
append(data, n); append(data, element); encode(data, refs, pointer, element); return 0;
}
element = type[4]; bytes = packed(element);
- if (rt.isobj(pointer)) n = pointer[-5] - rt.HDR;
+ if (rt.isobj(pointer)) { unbounded n = pointer[-5] - rt.HDR; }
else if (element[0] == 2) n = rt.len_w(pointer) + 1;
else n = size(element);
append(data, n);