Add new test case to check stack integrity on complex stack frames. - lightning.git - Portable just-in-time compiler library

index : lightning.git
Portable just-in-time compiler library
summary refs log tree commit diff
path: root/lib/jit_mips-cpu.c
diff options
context:
space:
mode:
authorpcpa <paulo.cesar.pereira.de.andrade@gmail.com>2012年12月19日 18:07:12 -0200
committerpcpa <paulo.cesar.pereira.de.andrade@gmail.com>2012年12月19日 18:07:12 -0200
commita74318a1d715a7f9ce9c99ae81c3038645efcc10 (patch)
tree5b13fe85aa14c298324b238c8e6140ee14f392b0 /lib/jit_mips-cpu.c
parentb43ea1f908866baaf14586e6d048bff4dbf6db1f (diff)
downloadlightning-a74318a1d715a7f9ce9c99ae81c3038645efcc10.tar.gz
Add new test case to check stack integrity on complex stack frames.
* check/stack.ok, check/stack.tst: New files to test data integrity on a deep chain of stack frames. * lib/jit_arm.c, lib/jit_arm-cpu.c, lib/jit_mips.c, lib/jit_mips-cpu.c, lib/jit_ppc.c, lib/jit_ppc-cpu.c, lib/jit_x86.c, lib/jit_x86-cpu.c: Calculate _jit->function->stack in the emit stage, otherwise it will calculate it wrong if need to jit_allocai space to spill registers. * lib/lightning.c: Correct wrong offset when updating the "current" jit function pointer in the code that may need to allocate stack space to spill registers. * check/lightning.c: Correct off by one data space check. * check/Makefile.am: Update for new test case.
Diffstat (limited to 'lib/jit_mips-cpu.c')
-rw-r--r--lib/jit_mips-cpu.c 5
1 files changed, 5 insertions, 0 deletions
diff --git a/lib/jit_mips-cpu.c b/lib/jit_mips-cpu.c
index 8749300..5e5c598 100644
--- a/lib/jit_mips-cpu.c
+++ b/lib/jit_mips-cpu.c
@@ -2697,6 +2697,11 @@ _calli(jit_state_t *_jit, jit_word_t i0)
static void
_prolog(jit_state_t *_jit, jit_node_t *node)
{
+ _jit->function->stack = ((/* first 16 bytes must be allocated */
+ (_jit->function->self.alen > 16 ?
+ _jit->function->self.alen : 16) -
+ /* align stack at 8 bytes */
+ _jit->function->self.aoff) + 7) & -8;
/* callee save registers */
subi(_SP_REGNO, _SP_REGNO, stack_framesize);
#if __WORDSIZE == 32
generated by cgit v1.2.3 (git 2.39.1) at 2025年09月28日 08:36:29 +0000

AltStyle によって変換されたページ (->オリジナル) /