Skip to content

Commit 17be0a2

Browse files
committed
Fix x86_64 unwind
1 parent 965a543 commit 17be0a2

File tree

1 file changed

+1
-5
lines changed

1 file changed

+1
-5
lines changed

Python/jit_unwind.c

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -535,7 +535,7 @@ static void elf_init_ehframe(ELFObjectContext* ctx, int absolute_addr) {
535535
* conventions and register usage patterns.
536536
*/
537537
#ifdef __x86_64__
538-
/* x86_64 calling convention unwinding rules with frame pointer */
538+
/* x86_64 calling convention unwinding rules; keep CFA on %rbp */
539539
# if defined(__CET__) && (__CET__ & 1)
540540
DWRF_U8(DWRF_CFA_advance_loc | 4); // Advance past endbr64 (4 bytes)
541541
# endif
@@ -547,10 +547,6 @@ static void elf_init_ehframe(ELFObjectContext* ctx, int absolute_addr) {
547547
DWRF_U8(DWRF_CFA_advance_loc | 3); // Advance past mov %rsp,%rbp (3 bytes)
548548
DWRF_U8(DWRF_CFA_def_cfa_register); // def_cfa_register r6
549549
DWRF_UV(DWRF_REG_BP); // Use base pointer register
550-
DWRF_U8(DWRF_CFA_advance_loc | 3); // Advance past call *%rcx (2 bytes) + pop %rbp (1 byte) = 3
551-
DWRF_U8(DWRF_CFA_def_cfa); // def_cfa r7 ofs 8
552-
DWRF_UV(DWRF_REG_SP); // Use stack pointer register
553-
DWRF_UV(8); // New offset: SP + 8
554550
#elif defined(__aarch64__) && defined(__AARCH64EL__) && !defined(__ILP32__)
555551
/* AArch64 calling convention unwinding rules */
556552
DWRF_U8(DWRF_CFA_advance_loc | 1); // Advance by 1 instruction (4 bytes)

0 commit comments

Comments
 (0)