Ignore extra arguments.

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

View File

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