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 / qualification / om2 / baseline / slice-witness.om

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