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 / qualification / om2 / baseline / slice-witness.om
| 1 | note SPDX-License-Identifier: Apache-2.0 |
| 2 | note Weakened-guard witness (#748): write 4 bytes from offset o = 2^64-2 of a 4-byte array to /dev/null. |
| 3 | note o and k = 4 are the issue's overflow pair (fixtures/obligations.txt, first slice row): the |
| 4 | note wrapped sum o+k = 2 <= len 4 is TRUE but k <= len - o is FALSE. A correct compiler traps 3 |
| 5 | note before the system call (exit 103, no output). A compiler whose check is the wrapped sum lets |
| 6 | note the call run; /dev/null accepts the bytes without reading them, so the mutant path is |
| 7 | note deterministic: it prints WRAPPED_SLICE_ACCEPTED_4 and a newline and exits 0. |
| 8 | text devnull "/dev/null" |
| 9 | text accepted "WRAPPED_SLICE_ACCEPTED_4\n" |
| 10 | fn main to int |
| 11 | a = new uchar 4 0 |
| 12 | f = fopen devnull 0 len devnull 1 0 |
| 13 | if lt f 0 |
| 14 | ret 90 |
| 15 | end |
| 16 | o = ulong 18446744073709551614 |
| 17 | r = write int f a o 4 |
| 18 | if eq r 4 |
| 19 | w = write 1 accepted 0 len accepted |
| 20 | ret 0 |
| 21 | end |
| 22 | ret 91 |
| 23 | end |