Skip to content

Commit d808be4

Browse files
committed
chore: add more test for the semantics
1 parent 61ac061 commit d808be4

13 files changed

+86
-7550
lines changed

kmir/src/kmir/kdist/mir-semantics/rt/data.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1055,6 +1055,7 @@ This eliminates any `Deref` projections from the place, and also resolves `Index
10551055
// rule #projectionsFor(CtxPointerOffset(OFFSET, ORIGIN_LENGTH) CTXS, PROJS) => #projectionsFor(CTXS, projectionElemSubslice(OFFSET, ORIGIN_LENGTH, false) PROJS)
10561056
rule #projectionsFor(CtxPointerOffset( _, OFFSET, ORIGIN_LENGTH) CTXS, PROJS) => #projectionsFor(CTXS, PointerOffset(OFFSET, ORIGIN_LENGTH) PROJS)
10571057
1058+
// Borrowing a zero-sized local that is still `NewLocal`: materialise a dummy ZST value so projection traversal succeeds without reading uninitialised data.
10581059
rule <k> rvalueRef(_REGION, KIND, place(local(I), PROJS))
10591060
=> #traverseProjection(toLocal(I), Aggregate(variantIdx(0), .List), PROJS, .Contexts)
10601061
~> #forRef(#mutabilityOf(KIND), metadata(noMetadataSize, 0, noMetadataSize))

0 commit comments

Comments
 (0)