We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent f2b0d54 commit 2beb5e9Copy full SHA for 2beb5e9
ws.jq
@@ -310,9 +310,11 @@ def exec_inst($op; $arg):
310
def top2: at(1);
311
def assert_div: assert(top != 0; "zero divisor");
312
def store($addr; $val):
313
+ assert($addr >= 0; "store at negative address") |
314
.max_addr = ([.max_addr, $addr] | max) |
315
.h[$addr|tostring] = $val;
316
def retrieve($addr):
317
+ assert($addr >= 0; "retrieve at negative address") |
318
assert((.check_retrieve|not) or $addr <= .max_addr;
319
"retrieve above maximum stored address (\($addr) > \(.max_addr))") |
320
.h[$addr|tostring] // 0;
0 commit comments