Assert that the non-fixed inputs to return match the function's signature.
This commit is contained in:
committed by
Benjamin Bouvier
parent
05c0b3bdd1
commit
681cb5e20a
@@ -348,6 +348,11 @@ impl<'a> Context<'a> {
|
||||
// Similarly, for return instructions, collect uses of ABI-defined
|
||||
// return values.
|
||||
if self.cur.func.dfg[inst].opcode().is_return() {
|
||||
debug_assert_eq!(
|
||||
self.cur.func.dfg.inst_variable_args(inst).len(),
|
||||
self.cur.func.signature.returns.len(),
|
||||
"The non-fixed arguments in a return should follow the function's signature."
|
||||
);
|
||||
for (ret_idx, (ret, &arg)) in
|
||||
self.cur.func.signature.returns.iter().zip(args).enumerate()
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user