tests: audit swap leak and remaining source rule boundaries
This commit is contained in:
1 parent
03305f0957
commit
ee09a7a290
12 files changed
+408
-10
No files matched your search
@@ -1546,6 +1546,171 @@
|
||||
"kind": "air_only",
|
||||
"spec": "docs/spec/15-source-language.md \u00a78",
|
||||
"rule": "Only registered intrinsic names emit AIR intrinsic calls. An undeclared io.teleport in source is ordinary E7002 name resolution, not an unknown AIR intrinsic; user functions are emitted as ordinary calls."
|
||||
},
|
||||
"phase3/reject/channels_endpoint_element.air": {
|
||||
"kind": "same_code",
|
||||
"site": "instruction",
|
||||
"spec": "docs/spec/04-concurrency-and-atomics.md \u00a738.1; docs/spec/15-source-language.md \u00a710",
|
||||
"rule": "channel.make has sender<u64> elements, requiring reserved channel_transfer. Both sides retain that feature/construct at channel.make; this diagnostic supplies no closure or canonical repair header."
|
||||
},
|
||||
"phase3/reject/select_target_arity.air": {
|
||||
"kind": "source_error",
|
||||
"spec": "docs/spec/15-source-language.md \u00a77",
|
||||
"rule": "A select send closed edge omits its unsent value binding. Source checks the authored binding list before emitting a continuation, with outcome closed and expected 1.",
|
||||
"analogues": [
|
||||
{
|
||||
"source": "source/reject_twins/analogue_select_closed_arity.aji",
|
||||
"codes": [
|
||||
"E7005"
|
||||
],
|
||||
"fields": {
|
||||
"outcome": "closed",
|
||||
"expected": "1"
|
||||
}
|
||||
}
|
||||
]
|
||||
},
|
||||
"phase4/reject/iref_eq_types.air": {
|
||||
"kind": "source_error",
|
||||
"spec": "docs/spec/15-source-language.md \u00a78; \u00a710",
|
||||
"rule": "Equality compares iref<u64> and iref<u8>. Source checks operand types before emitting iref.eq.",
|
||||
"analogues": [
|
||||
{
|
||||
"source": "source/reject_twins/analogue_iref_eq_types.aji",
|
||||
"codes": [
|
||||
"E7005"
|
||||
],
|
||||
"fields": {
|
||||
"expected": "iref<u64>",
|
||||
"found": "iref<u8>"
|
||||
}
|
||||
}
|
||||
]
|
||||
},
|
||||
"phase4/reject/island_alloc_via_ref.air": {
|
||||
"kind": "source_error",
|
||||
"spec": "docs/spec/15-source-language.md \u00a78; \u00a710",
|
||||
"rule": "island.alloc receives a named shared ref<island<u64>> binding; allocation requires a named exclusive binding. Source rejects before AIR with found; it supplies no expected field.",
|
||||
"analogues": [
|
||||
{
|
||||
"source": "source/reject_twins/analogue_island_alloc_ref.aji",
|
||||
"codes": [
|
||||
"E7005"
|
||||
],
|
||||
"fields": {
|
||||
"found": "ref<island<u64>>"
|
||||
}
|
||||
}
|
||||
]
|
||||
},
|
||||
"phase3/reject/cancel_shield_order.air": {
|
||||
"kind": "air_only",
|
||||
"spec": "docs/spec/15-source-language.md \u00a73; \u00a77",
|
||||
"rule": "Source shields nest by construction and end in reverse order on every normal exit. Shield handles are not source values and cannot be block arguments. The reversed ending/renamed-stack context of this AIR cannot be authored."
|
||||
},
|
||||
"phase3/reject/cfg_provenance_shield_order.air": {
|
||||
"kind": "air_only",
|
||||
"spec": "docs/spec/15-source-language.md \u00a73; \u00a77",
|
||||
"rule": "Source shields nest by construction and end in reverse order on every normal exit. Shield handles are not source values and cannot be block arguments. The reversed ending/renamed-stack context of this AIR cannot be authored."
|
||||
},
|
||||
"phase3/reject/cfg_provenance_shield_stack_join.air": {
|
||||
"kind": "air_only",
|
||||
"spec": "docs/spec/15-source-language.md \u00a73; \u00a77",
|
||||
"rule": "Source shields nest by construction and end in reverse order on every normal exit. Shield handles are not source values and cannot be block arguments. The reversed ending/renamed-stack context of this AIR cannot be authored."
|
||||
},
|
||||
"phase3/reject/cfg_provenance_scope_alone.air": {
|
||||
"kind": "air_only",
|
||||
"spec": "docs/spec/15-source-language.md \u00a74; \u00a77",
|
||||
"rule": "A source scope name is only a lexical identifier for task.spawn, never an ordinary assigned or yielded value. The renamed scope block parameter that is the subject of this AIR regression cannot be emitted. A plain unjoined-child E4301 would drop that context."
|
||||
},
|
||||
"phase3/reject/cfg_provenance_scope_task.air": {
|
||||
"kind": "air_only",
|
||||
"spec": "docs/spec/15-source-language.md \u00a74; \u00a77",
|
||||
"rule": "A source scope name is only a lexical identifier for task.spawn, never an ordinary assigned or yielded value. The renamed scope block parameter that is the subject of this AIR regression cannot be emitted. A plain unjoined-child E4301 would drop that context."
|
||||
},
|
||||
"phase3/reject/cfg_provenance_guard_parent.air": {
|
||||
"kind": "air_only",
|
||||
"spec": "docs/spec/15-source-language.md \u00a73; \u00a77",
|
||||
"rule": "The lock guard is never a source value; source branches inside the lock use the originating guard rather than transferring it as a block argument. This AIR regression explicitly forwards the guard through br before ending its parent, a context with no implemented source spelling."
|
||||
},
|
||||
"modules/nominal_call.air": {
|
||||
"kind": "source_error",
|
||||
"spec": "docs/spec/15-source-language.md \u00a75; \u00a710; \u00a714.2",
|
||||
"rule": "A function receives a structurally identical but nominally distinct struct. The source analogue uses two local nominal declarations rather than package linking; the checked argument-type mismatch precedes AIR.",
|
||||
"analogues": [
|
||||
{
|
||||
"source": "source/reject_twins/analogue_nominal_call.aji",
|
||||
"codes": [
|
||||
"E7005"
|
||||
],
|
||||
"fields": {
|
||||
"expected": "@PairA",
|
||||
"found": "@PairB"
|
||||
}
|
||||
}
|
||||
]
|
||||
},
|
||||
"phase0/reject/syntax_error.air": {
|
||||
"kind": "air_only",
|
||||
"spec": "docs/spec/15-source-language.md \u00a710",
|
||||
"rule": "The missing comma is in the AIR text operand grammar, which source does not expose. A source syntax error uses a different grammar and E7001; malformed generated AIR instead reports E7900 as a compiler bug."
|
||||
},
|
||||
"phase2/reject/no_capability_comparison.air": {
|
||||
"kind": "air_only",
|
||||
"spec": "docs/spec/15-source-language.md \u00a78; \u00a710",
|
||||
"rule": "eq.cap is not an AIR opcode and its undefined result adds E5001. Source equality on capabilities rejects by its operand type rule, before AIR; it cannot emit this absent opcode and invalid SSA context."
|
||||
},
|
||||
"phase5/reject/add_bool.air": {
|
||||
"kind": "source_error",
|
||||
"spec": "docs/spec/15-source-language.md \u00a710; \u00a712",
|
||||
"rule": "atomic.add.wrap is used on a bool cell with a bool operand. Source checks its integer-cell requirement before emitting the operation; found remains bool. Source anchors this at the bool value operand; AIR anchors it at the ref<atomic<bool>> cell operand.",
|
||||
"analogues": [
|
||||
{
|
||||
"source": "source/reject_twins/analogue_atomic_add_bool.aji",
|
||||
"codes": [
|
||||
"E7005"
|
||||
],
|
||||
"fields": {
|
||||
"found": "bool"
|
||||
}
|
||||
}
|
||||
]
|
||||
},
|
||||
"linear/builtin_take.air": {
|
||||
"kind": "air_only",
|
||||
"spec": "docs/spec/15-source-language.md \u00a75; \u00a716",
|
||||
"rule": "alloc_error is a Copy built-in enum. Ordinary Copy matches emit enum.switch, and move of a Copy value outside specialization is rejected; even specialized Copy matches remain non-consuming. Source cannot emit enum.take for this built-in."
|
||||
},
|
||||
"linear/copy.air": {
|
||||
"kind": "air_only",
|
||||
"spec": "docs/spec/15-source-language.md \u00a75; \u00a716",
|
||||
"rule": "An aggregate containing own<u64> is linear. Plain named use in a consuming initializer requires move (E7003); move transfers rather than duplicates the aggregate. The source frontend cannot emit AIR copy of this linear struct."
|
||||
},
|
||||
"phase0/reject/unknown_opcode.air": {
|
||||
"kind": "air_only",
|
||||
"spec": "docs/spec/15-source-language.md \u00a78; \u00a710",
|
||||
"rule": "Source has no spelling for arbitrary AIR opcodes. An unknown function name rejects in name resolution; the frontend emits only registered operations, so frobnicate plus the resulting undefined SSA value is an AIR-only malformed module."
|
||||
},
|
||||
"phase2/reject/borrow_parameter_not_from_allocation.air": {
|
||||
"kind": "air_only",
|
||||
"spec": "docs/spec/15-source-language.md \u00a74; \u00a75; \u00a719",
|
||||
"rule": "The regression passes a borrow through br as a block parameter, requiring reserved borrow_joins. A source borrow is bound lexically by ref/mut, cannot be assigned as a variable or yielded by a nested block, if or match, and cannot reach the generated join as an ordinary value. No source spelling preserves this borrow-parameter context."
|
||||
},
|
||||
"linear/swap_leak.air": {
|
||||
"kind": "same_code",
|
||||
"site": "instruction",
|
||||
"spec": "docs/spec/03-memory-model.md \u00a725; docs/spec/15-source-language.md \u00a716",
|
||||
"rule": "The array.make/unpack owner enters Maybe::some; value.swap replaces it with none. The original complete value is consumed only on the slot some arm and leaks at ret on the slot none arm. Full type tables and pinned AIR/source/lowering preserve that branch context; operation counts alone would allow leaking on the other arm.",
|
||||
"match_type_declarations": true,
|
||||
"audited_context": {
|
||||
"air": "ffd1b3ae7fd6462601c7dd9044322d9d430ef798fa645b67763d0316df44c831",
|
||||
"sources": {
|
||||
"source/reject_twins/linear_swap_leak.aji": "c675d231336f17eadb39d7e63138a1c1b67500c464c59b09f31cb7ea1ff66ed5"
|
||||
},
|
||||
"lowered": {
|
||||
"source/reject_twins/linear_swap_leak.aji": "6f9fa0d8ef40b75951c2a2042d1d171c221268301df18b38775b74a47f606cc7"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user