mirror of
https://github.com/frida/tinycc
synced 2024-11-28 10:33:07 +03:00
Fix stack alignment on 8 bytes at function call
Ensure stack pointer is correctly adjusted in prolog to be aligned on 8 bytes after the change of frame linking.
This commit is contained in:
parent
f3e5649150
commit
0f81512d7d
@ -1231,7 +1231,7 @@ from_stack:
|
||||
}
|
||||
last_itod_magic=0;
|
||||
leaffunc = 1;
|
||||
loc = -12;
|
||||
loc = 0;
|
||||
}
|
||||
|
||||
/* generate function epilog */
|
||||
@ -1255,9 +1255,9 @@ void gfunc_epilog(void)
|
||||
diff = (-loc + 3) & -4;
|
||||
#ifdef TCC_ARM_EABI
|
||||
if(!leaffunc)
|
||||
diff = (diff + 7) & -8;
|
||||
diff = ((diff + 11) & -8) - 4;
|
||||
#endif
|
||||
if(diff > 12) {
|
||||
if(diff > 0) {
|
||||
x=stuff_const(0xE24BD000, diff); /* sub sp,fp,# */
|
||||
if(x)
|
||||
*(uint32_t *)(cur_text_section->data + func_sub_sp_offset) = x;
|
||||
|
Loading…
Reference in New Issue
Block a user