|
25 | 25 | #include <stdio.h> |
26 | 26 | #include <string.h> |
27 | 27 |
|
28 | | -#include "shadow_stack_unwind.h" |
29 | 28 | #include "config.h" |
30 | 29 | #include "libunwind.h" |
31 | 30 | #include "libunwind_ext.h" |
| 31 | +#include "shadow_stack_unwind.h" |
32 | 32 | #include "unwind.h" |
33 | 33 |
|
34 | 34 | #if !defined(_LIBUNWIND_ARM_EHABI) && !defined(__USING_SJLJ_EXCEPTIONS__) && \ |
|
62 | 62 | void *ssJumpAddress = __libunwind_ss_get_jump_target(); \ |
63 | 63 | __asm__ volatile("push %%edi\n\t" \ |
64 | 64 | "sub $4, %%esp\n\t" \ |
65 | | - "jmp *%%edx\n\t" :: "D"(ssRegContext), \ |
| 65 | + "jmp *%%edx\n\t" ::"D"(ssRegContext), \ |
66 | 66 | "d"(ssJumpAddress)); \ |
67 | 67 | } while (0) |
68 | 68 | #elif defined(_LIBUNWIND_TARGET_X86_64) |
|
72 | 72 | _LIBUNWIND_POP_SS_SSP((fn)); \ |
73 | 73 | void *ssRegContext = __libunwind_ss_get_registers((cursor)); \ |
74 | 74 | void *ssJumpAddress = __libunwind_ss_get_jump_target(); \ |
75 | | - __asm__ volatile("jmpq *%%rdx\n\t" :: "D"(ssRegContext), \ |
| 75 | + __asm__ volatile("jmpq *%%rdx\n\t" ::"D"(ssRegContext), \ |
76 | 76 | "d"(ssJumpAddress)); \ |
77 | 77 | } while (0) |
78 | 78 | #elif defined(_LIBUNWIND_TARGET_AARCH64) |
@@ -266,8 +266,9 @@ unwind_phase2(unw_context_t *uc, unw_cursor_t *cursor, _Unwind_Exception *except |
266 | 266 | if (shadowStackTop != 0) { |
267 | 267 | unw_word_t retInNormalStack; |
268 | 268 | __unw_get_reg(cursor, UNW_REG_IP, &retInNormalStack); |
269 | | - unsigned long retInShadowStack = *(unsigned long *) |
270 | | - (shadowStackTop + __shadow_stack_step_size * framesWalked); |
| 269 | + unsigned long retInShadowStack = |
| 270 | + *(unsigned long *)(shadowStackTop + |
| 271 | + __shadow_stack_step_size * framesWalked); |
271 | 272 | if (retInNormalStack != retInShadowStack) |
272 | 273 | return _URC_FATAL_PHASE2_ERROR; |
273 | 274 | } |
|
0 commit comments