Skip to content

Commit

Permalink
Callwitharg: fix argument parsing for aarch64
Browse files Browse the repository at this point in the history
  • Loading branch information
Andrew Fasano committed Jun 5, 2024
1 parent 4eb0775 commit d0407b3
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion panda/plugins/callwitharg/callwitharg.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -98,10 +98,15 @@ typedef struct {
} Arguments;

bool _get_args_for_arch(CPUArchState *env, Arguments *args, int N) {
#ifdef TARGET_ARM
#if defined(TARGET_ARM) && !defined(TARGET_AARCH64)
for (int i = 0; i < N; ++i) {
args->args[i] = env->regs[i];
}
#elif defined(TARGET_AARCH64)
for (int i = 0; i < N; ++i) {
// aarch64 uses xregs over regs
args->args[i] = env->xregs[i];
}
#elif defined(TARGET_MIPS)
for (int i = 0; i < N; ++i) {
args->args[i] = env->active_tc.gpr[4 + i];
Expand Down

0 comments on commit d0407b3

Please sign in to comment.