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_struct_put_idx_trap.om
| 1 | note Struct put: value and index are both bad (the value adds past the maximum, the index is past the field). |
| 2 | note omc traps 3 (exit 103): the index is checked before the value is computed. |
| 3 | struct H v uint 4 end |
| 4 | fn big to uint |
| 5 | ret 4294967295 |
| 6 | end |
| 7 | fn five to ulong |
| 8 | ret 4 |
| 9 | end |
| 10 | fn main to int |
| 11 | h = new H 1 |
| 12 | put h v five add big 1 |
| 13 | ret 0 |
| 14 | end |