summaryrefslogtreecommitdiff
path: root/x86_64-gen.c
diff options
context:
space:
mode:
Diffstat (limited to 'x86_64-gen.c')
-rw-r--r--x86_64-gen.c9
1 files changed, 9 insertions, 0 deletions
diff --git a/x86_64-gen.c b/x86_64-gen.c
index d7cb895..e33a38a 100644
--- a/x86_64-gen.c
+++ b/x86_64-gen.c
@@ -1034,6 +1034,7 @@ void gfunc_epilog(void)
saved_ind = ind;
ind = func_sub_sp_offset - FUNC_PROLOG_SIZE;
/* align local size to word & save local variables */
+ func_scratch = (func_scratch + 15) & -16;
v = (func_scratch + -loc + 15) & -16;
if (v >= 4096) {
@@ -2222,6 +2223,14 @@ ST_FUNC void gen_vla_sp_restore(int addr) {
gen_modrm64(0x8b, TREG_RSP, VT_LOCAL, NULL, addr);
}
+#ifdef TCC_TARGET_PE
+/* Save result of gen_vla_alloc onto the stack */
+ST_FUNC void gen_vla_result(int addr) {
+ /* mov %rax,addr(%rbp)*/
+ gen_modrm64(0x89, TREG_RAX, VT_LOCAL, NULL, addr);
+}
+#endif
+
/* Subtract from the stack pointer, and push the resulting value onto the stack */
ST_FUNC void gen_vla_alloc(CType *type, int align) {
#ifdef TCC_TARGET_PE