omega-mv
Omega: a language for verified programs, semantic identity and machine realization. Seed-born work and existing implementations have distinct provenance.
Brought by drakestapleton
omega-mv / si / harness / examples / mistake_short_circuit.om
| 1 | note mistake_short_circuit: and/or evaluate both sides, so this still loads a[4] and traps 3 (exit 103) |
| 2 | note fix: test the bound in an outer if, then load inside it |
| 3 | fn main to int |
| 4 | a = new uchar 4 0 |
| 5 | i = ulong 4 |
| 6 | if and lt i len a eq get a i 0 |
| 7 | ret 1 |
| 8 | end |
| 9 | ret 0 |
| 10 | end |