Ignore extra arguments.

This commit is contained in:
losfair
2019-11-19 02:46:31 +08:00
parent 06a7e5424b
commit ddbdb3e585

View File

@ -302,7 +302,6 @@ impl RunnableModule for X64ExecutionContext {
{ {
let callable: extern "C" fn(u64, u64, u64, u64, u64, u64) -> u64 = let callable: extern "C" fn(u64, u64, u64, u64, u64, u64) -> u64 =
std::mem::transmute(func); std::mem::transmute(func);
if args.len() <= 5 {
callable( callable(
ctx as u64, ctx as u64,
args.get(0).cloned().unwrap_or(0), args.get(0).cloned().unwrap_or(0),
@ -310,10 +309,7 @@ impl RunnableModule for X64ExecutionContext {
args.get(2).cloned().unwrap_or(0), args.get(2).cloned().unwrap_or(0),
args.get(3).cloned().unwrap_or(0), args.get(3).cloned().unwrap_or(0),
args.get(4).cloned().unwrap_or(0), args.get(4).cloned().unwrap_or(0),
) );
} else {
panic!("aarch64 backend currently supports at most 5 arguments");
}
} }
}, },
Some(execution_context.breakpoints.clone()), Some(execution_context.breakpoints.clone()),