aboutsummaryrefslogtreecommitdiff
path: root/x86_64-gen.c
diff options
context:
space:
mode:
Diffstat (limited to 'x86_64-gen.c')
-rw-r--r--x86_64-gen.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/x86_64-gen.c b/x86_64-gen.c
index 7c64f3b..247027a 100644
--- a/x86_64-gen.c
+++ b/x86_64-gen.c
@@ -772,8 +772,6 @@ void gfunc_epilog(void)
/* align local size to word & save local variables */
v = (func_scratch + -loc + 15) & -16;
- pe_add_unwind_data(ind, saved_ind, v);
-
if (v >= 4096) {
Sym *sym = external_global_sym(TOK___chkstk, &func_old_type, 0);
oad(0xb8, v); /* mov stacksize, %eax */
@@ -785,7 +783,10 @@ void gfunc_epilog(void)
o(0xec8148); /* sub rsp, stacksize */
gen_le32(v);
}
- ind = saved_ind;
+
+ cur_text_section->data_offset = saved_ind;
+ pe_add_unwind_data(ind, saved_ind, v);
+ ind = cur_text_section->data_offset;
}
#else