- air: string literals (trusted line only), trusted obligation on functions, assume, borrow.index.unchecked - verifier: unsafe stage (E6001 outside_boundary / trusted_declares_unsafe); effect stage leaves unsafe to it, so trusted functions discharge it; assume establishes bounds facts - interp: T0009 for detected unsafe precondition violations - aji check --report unsafe: trusted functions with obligations, unsafe functions, unsafe operations with their boundary - feature unsafe published and supported; 10 conformance tests; 3000 mutants without a crash
17 lines
334 B
LLVM
17 lines
334 B
LLVM
; A false assume is a detected unsafe precondition violation.
|
|
; expect: run
|
|
; trap: T0009
|
|
; phase: 2
|
|
; spec: docs/spec/13-contracts-and-unsafe.md
|
|
module test.unsafe_assume_violated
|
|
air 0
|
|
lang 0.1
|
|
features [arrays, effects, ownership, unsafe]
|
|
|
|
fn @main() -> void
|
|
effects [unsafe]
|
|
entry:
|
|
%f = const.bool false
|
|
assume %f
|
|
ret
|