Phase 2: unsafe operations and trusted boundaries (RFC 0009)
- 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
This commit is contained in:
1 parent
c510a37cf9
commit
008654999e
24 files changed
+422
-18
No files matched your search
@@ -487,7 +487,7 @@ fn checkInst(fc: *FnCtx, inst: air.Inst) !void {
|
||||
const s = fc.typeOf(x.src);
|
||||
if (!s.isSlice() or !s.inner().?.eql(d.inner().?)) return fc.kindError(span, x.src, try std.fmt.allocPrint(fc.c.arena, "slice<{s}> or slice_mut<{s}>", .{ try fc.c.typeName(d.inner().?), try fc.c.typeName(d.inner().?) }));
|
||||
},
|
||||
.guard => |v| try fc.expectValue(span, v, .bool),
|
||||
.guard, .assume => |v| try fc.expectValue(span, v, .bool),
|
||||
.arith => |x| {
|
||||
try fc.expectValue(span, x.a, .{ .int = x.ty });
|
||||
try fc.expectValue(span, x.b, .{ .int = x.ty });
|
||||
|
||||
Reference in new issue
Block a user