Skip to content

Commit 4b3f9ae

Browse files
committed
Fix #8590: Handle empty structs in type legalization
Return LegalType::simple(type) instead of LegalType() for empty structs to ensure they are recognized as valid simple operands by downstream IR passes.
1 parent 206973b commit 4b3f9ae

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

source/slang/slang-legalize-types.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -494,11 +494,11 @@ struct TupleTypeBuilder
494494

495495
LegalType getResult()
496496
{
497-
// If this is an empty struct, return a none type
497+
// If this is an empty struct, return a simple type
498498
// This helps get rid of emtpy structs that often trips up the
499499
// downstream compiler
500500
if (!anyOrdinary && !anySpecial && !anyComplex)
501-
return LegalType();
501+
return LegalType::simple(type);
502502

503503
// If we didn't see anything "special"
504504
// then we can use the type as-is.

0 commit comments

Comments
 (0)