Skip to content

Commit 864994b

Browse files
committed
feat(rt): support zero-sized constant
1 parent 596829b commit 864994b

File tree

1 file changed

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

1 file changed

+7
-0
lines changed

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

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -128,6 +128,13 @@ Constant operands are simply decoded according to their type.
128128
...
129129
</k>
130130
requires typeInfoVoidType =/=K lookupTy(TY)
131+
132+
// Fallback for zero-sized constants whose type metadata was not emitted.
133+
rule <k> operandConstant(constOperand(_, _, mirConst(constantKindZeroSized, TY, _)))
134+
=> Aggregate(variantIdx(0), .List)
135+
...
136+
</k>
137+
requires typeInfoVoidType ==K lookupTy(TY)
131138
```
132139

133140
### Copying and Moving

0 commit comments

Comments
 (0)