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 / nom_layout_put_idx_trap.om
| 1 | note Layout put: the index is past the array field and the value would overflow (uchar add past 255). omc |
| 2 | note decides which trap fires first; the gate requires ng to give the same exit. Exit is the trap. |
| 3 | om2 |
| 4 | layout lo 8 |
| 5 | field a uchar 4 at 0 little |
| 6 | end |
| 7 | fn maxb to uchar |
| 8 | ret 255 |
| 9 | end |
| 10 | fn five to ulong |
| 11 | ret 4 |
| 12 | end |
| 13 | fn setit c edit lo to void |
| 14 | put c a five add maxb 1 |
| 15 | end |
| 16 | fn main to int |
| 17 | c = new uchar 8 0 |
| 18 | setit c |
| 19 | ret 0 |
| 20 | end |