Skip to content

Commit e95d02c

Browse files
committed
s2s: fix parsing of non-void functions
1 parent 38df23b commit e95d02c

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

src/frontend/spirv/s2s.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -692,9 +692,9 @@ static size_t parse_spv_instruction_at(SpvParser* parser, size_t instruction_off
692692
}
693693
case SpvOpTypeFunction: {
694694
parser->defs[result].type = Typ;
695-
Nodes return_ts = shd_unwrap_multiple_yield_types(a, get_def_type(parser, instruction[2]));
696-
assert(return_ts.count < 2);
697-
const Type* return_t = return_ts.count > 1 ? qualified_type_helper(a, a->config.target.scopes.bottom, shd_first(return_ts)) : unit_type(a);
695+
const Type* return_t = get_def_type(parser, instruction[2]);
696+
if (return_t != unit_type(a))
697+
return_t = qualified_type_helper(a, a->config.target.scopes.bottom, return_t);
698698
LARRAY(const Type*, param_ts, size - 3);
699699
for (size_t i = 0; i < size - 3; i++)
700700
param_ts[i] = qualified_type_helper(a, a->config.target.scopes.bottom, get_def_type(parser, instruction[3 + i]));

0 commit comments

Comments
 (0)