Fix a bug in analyze_call().

The call arguments on call_indirect should not include the fixed callee
argument.

Add legalizer assertions to verify that signatures are actually valid
after legalization. If not, we would get infinite legalizer loops.
This commit is contained in:
Jakob Stoklund Olesen
2017-03-17 12:34:03 -07:00
parent d881ed331b
commit f15651132b
3 changed files with 56 additions and 19 deletions

View File

@@ -310,7 +310,7 @@ impl InstructionData {
CallInfo::Direct(func_ref, &args.as_slice(pool))
}
&InstructionData::IndirectCall { sig_ref, ref args, .. } => {
CallInfo::Indirect(sig_ref, &args.as_slice(pool))
CallInfo::Indirect(sig_ref, &args.as_slice(pool)[1..])
}
_ => CallInfo::NotACall,
}