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 / omc / sites / found-foffset-1.om
| 1 | note sites: found by a one-token change of a tracked program (41 to 120 lines); reaches the omc error site in foffset (code 16) |
| 2 | note sizeof and offsetof are compile-time constants of type ulong; struct fields live in 8-byte cells. |
| 3 | struct S a uchar b ulong c uchar 3 end |
| 4 | fn main to int |
| 5 | if ne sizeof bool 1 |
| 6 | ret 1 |
| 7 | end |
| 8 | if ne sizeof uchar 1 |
| 9 | ret 2 |
| 10 | end |
| 11 | if ne sizeof ushort 2 |
| 12 | ret 3 |
| 13 | end |
| 14 | if ne sizeof uint 4 |
| 15 | ret 4 |
| 16 | end |
| 17 | if ne sizeof ulong 8 |
| 18 | ret 5 |
| 19 | end |
| 20 | if ne sizeof int 4 |
| 21 | ret 6 |
| 22 | end |
| 23 | if ne sizeof long 8 |
| 24 | ret 7 |
| 25 | end |
| 26 | if ne sizeof f32 4 |
| 27 | ret 8 |
| 28 | end |
| 29 | if ne sizeof f64 8 |
| 30 | ret 9 |
| 31 | end |
| 32 | if ne sizeof S 40 |
| 33 | ret 10 |
| 34 | end |
| 35 | if ne offsetof 255 a 0 |
| 36 | ret 11 |
| 37 | end |
| 38 | if ne offsetof S b 8 |
| 39 | ret 12 |
| 40 | end |
| 41 | if ne offsetof S c 16 |
| 42 | ret 13 |
| 43 | end |
| 44 | if ne add sizeof S offsetof S b 48 |
| 45 | ret 14 |
| 46 | end |
| 47 | ret 0 |
| 48 | end |