From ecb90de4cca29eb9664a1a8f68382512193eedc6 Mon Sep 17 00:00:00 2001 From: Pursuer <1596067968@qq.com> Date: Sat, 12 Jan 2019 01:52:52 +0800 Subject: [PATCH] FIX:Revert commit 3f05d88d5bda06b40280710089bd3ede3a8fdaa0 The function should to be saved to stack in some cases (fastcall on i386, struct argument on arm etc.). But I neglected. So I revert this commit. --- arm-gen.c | 2 +- arm64-gen.c | 2 +- i386-gen.c | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/arm-gen.c b/arm-gen.c index afbc23b6..e766ce43 100644 --- a/arm-gen.c +++ b/arm-gen.c @@ -1187,7 +1187,7 @@ again: /* Manually free remaining registers since next parameters are loaded * manually, without the help of gv(int). */ - save_regs(nb_args+1); + save_regs(nb_args); if(todo) { o(0xE8BD0000|todo); /* pop {todo} */ diff --git a/arm64-gen.c b/arm64-gen.c index 3d333155..efe42461 100644 --- a/arm64-gen.c +++ b/arm64-gen.c @@ -948,7 +948,7 @@ ST_FUNC void gfunc_call(int nb_args) vswap(); } - save_regs(1); + save_regs(0); arm64_gen_bl_or_b(0); --vtop; if (stack) diff --git a/i386-gen.c b/i386-gen.c index 646f261e..b6629d40 100644 --- a/i386-gen.c +++ b/i386-gen.c @@ -475,7 +475,7 @@ ST_FUNC void gfunc_call(int nb_args) } vtop--; } - save_regs(1); /* save used temporary registers */ + save_regs(0); /* save used temporary registers */ func_sym = vtop->type.ref; func_call = func_sym->f.func_call; /* fast call case */