sovereign-intelligence
Front door to Drake Stapleton's sovereign stack.
Brought by drakestapleton
sovereign-intelligence / tests / omc / examples / count_trap3.om
| 1 | note count_trap3: count checks its slice as read and write do, n <= len A and off <= len A - n, before it |
| 2 | note reads a byte; here off 5 and n 4 end one past an 8-byte array, so it traps 3, exit 103, whatever v is |
| 3 | om2 |
| 4 | text before "before\n" |
| 5 | fn main to int |
| 6 | k = write 1 before 0 len before |
| 7 | a = new uchar 8 10 |
| 8 | o = ulong 5 |
| 9 | n = count a o 4 10 |
| 10 | ret int n |
| 11 | end |