Skip to content

Commit

Permalink
apply the correct result type when lifting functions (#210)
Browse files Browse the repository at this point in the history
  • Loading branch information
incertia committed Nov 18, 2023
1 parent ba1f984 commit 0fed630
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion rspirv/lift/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -188,10 +188,11 @@ impl LiftContext {
let start_label = fun.blocks[0].label.as_ref().unwrap().result_id.unwrap();
let start_block = context.blocks.lookup_token(start_label);
let blocks = mem::replace(&mut context.blocks, LiftStorage::new()).unwrap();
let fun_ret = fun.def.as_ref().and_then(|d| d.result_type).expect("functions must have a result type");

functions.push(module::Function {
control: def.function_control,
result: context.types.append_id(1, Type::Void), //TODO: fty.return_type,
result: context.types.lookup_token(fun_ret),
parameters: Vec::new(),
blocks,
start_block,
Expand Down

0 comments on commit 0fed630

Please sign in to comment.