diff options
| author | 2026-10-14 15:58:58 +0330 | |
|---|---|---|
| committer | 2026-10-14 15:58:58 +0330 | |
| commit | d55b5fdf92a674a6495878f97a09e95bafdcba3f (patch) | |
| tree | e811149b65640a3e253e6ebdce41affddb53ac37 /src/lib/actor.zc | |
| parent | merge 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/actor.zc')
| -rw-r--r-- | src/lib/actor.zc | 4 |
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); |
