interplane.Get Omega
Read in your language

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

branch main Branches Tags History

omega-mv / seed / ng / front / cases / nom_layout_put_idx_trap.om

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