Skip to content

Commit 1b6dd51

Browse files
committed
fix(rt): recognize closure env refs in tuple-arg setup
1 parent 03747ff commit 1b6dd51

1 file changed

Lines changed: 7 additions & 1 deletion

File tree

  • kmir/src/kmir/kdist/mir-semantics

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

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -581,16 +581,22 @@ Therefore a heuristics is used here:
581581
// or the closure ref type pointee is missing from the type table
582582
andBool isRefType(lookupTy(tyOfLocal({LOCALS[CLOSURE]}:>TypedLocal)))
583583
andBool isTy(pointeeTy(lookupTy(tyOfLocal({LOCALS[CLOSURE]}:>TypedLocal))))
584-
andBool lookupTy({pointeeTy(lookupTy(tyOfLocal({LOCALS[CLOSURE]}:>TypedLocal)))}:>Ty) ==K typeInfoVoidType
584+
andBool (
585+
lookupTy({pointeeTy(lookupTy(tyOfLocal({LOCALS[CLOSURE]}:>TypedLocal)))}:>Ty) ==K typeInfoVoidType
586+
orBool isFunType(lookupTy({pointeeTy(lookupTy(tyOfLocal({LOCALS[CLOSURE]}:>TypedLocal)))}:>Ty))
587+
)
585588
[priority(45), preserves-definedness]
586589
587590
syntax Bool ::= isTupleType ( TypeInfo ) [function, total]
588591
| isRefType ( TypeInfo ) [function, total]
592+
| isFunType ( TypeInfo ) [function, total]
589593
// -------------------------------------------------------
590594
rule isTupleType(typeInfoTupleType(_, _)) => true
591595
rule isTupleType( _ ) => false [owise]
592596
rule isRefType(typeInfoRefType(_)) => true
593597
rule isRefType( _ ) => false [owise]
598+
rule isFunType(typeInfoFunType(_)) => true
599+
rule isFunType( _ ) => false [owise]
594600
595601
syntax KItem ::= #setTupleArgs ( Int , Value )
596602
| #setTupleArgs ( Int , List )

0 commit comments

Comments
 (0)