summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorkr.angelov <kr.angelov@gmail.com>2014-10-06 09:21:08 +0000
committerkr.angelov <kr.angelov@gmail.com>2014-10-06 09:21:08 +0000
commita50315396f36403fb58ad137f03f725a7dd79d49 (patch)
tree1e5eeb299a862a9db3ccfb16049b54875f5fddfb
parent889c0f3df401e98a0d5839654f9d460cde49663e (diff)
push a stack frame around recursive calls to guarantee that a nested call to a failing function will not crash
-rw-r--r--src/runtime/c/pgf/jit.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/src/runtime/c/pgf/jit.c b/src/runtime/c/pgf/jit.c
index 3f1bb36dd..3b851bf7e 100644
--- a/src/runtime/c/pgf/jit.c
+++ b/src/runtime/c/pgf/jit.c
@@ -1027,7 +1027,10 @@ pgf_jit_function(PgfReader* rdr, PgfAbstr* abstr,
gu_printf(out, err, "\n");
#endif
jit_pushr_p(JIT_R2);
+ jit_pushr_p(JIT_FP);
+ jit_movr_p(JIT_FP, JIT_SP);
jit_callr(JIT_R0);
+ jit_popr_p(JIT_FP);
jit_popr_p(JIT_VCLOS);
break;
}