Skip to content

Commit e260f98

Browse files
committed
fix(mir-semantics): Handle zero sized function constant decode
1 parent 66aec6d commit e260f98

File tree

1 file changed

+3
-0
lines changed
  • kmir/src/kmir/kdist/mir-semantics/rt

1 file changed

+3
-0
lines changed

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

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1468,6 +1468,9 @@ Zero-sized types can be decoded trivially into their respective representation.
14681468
// zero-sized array
14691469
rule <k> #decodeConstant(constantKindZeroSized, _TY, typeInfoArrayType(_, _))
14701470
=> Range(.List) ... </k>
1471+
// zero-sized function item (e.g., closures without captures)
1472+
rule <k> #decodeConstant(constantKindZeroSized, _TY, typeInfoFunType(_))
1473+
=> Aggregate(variantIdx(0), .List) ... </k>
14711474
```
14721475

14731476
Allocated constants of reference type with a single provenance map entry are decoded as references

0 commit comments

Comments
 (0)