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 / seed / ng / front / cases / for_latch_i8.om
| 1 | note for_latch_i8: a signed for counter that the body writes to its maximum. The latch adds 1 and that add |
| 2 | note overflows: omc traps 1 (exit 101). front-ir lowered the latch as an unchecked add, so the counter wrapped |
| 3 | note to -128 and the loop ran on to its bound (trap 4, exit 104). Bug hunt, ledger L1060. |
| 4 | fn main to int |
| 5 | n = ulong 0 |
| 6 | for k byte 100 bound 1000 |
| 7 | n = add n 1 |
| 8 | k = 127 |
| 9 | end |
| 10 | ret int n |
| 11 | end |