Skip to content

Commit 972edcb

Browse files
committed
cleanup compiler-rt formatting
1 parent d6375dd commit 972edcb

File tree

2 files changed

+27
-27
lines changed

2 files changed

+27
-27
lines changed

compiler-rt/lib/builtins/gcc_personality_v0.c

Lines changed: 27 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -35,11 +35,11 @@ EXCEPTION_DISPOSITION _GCC_specific_handler(PEXCEPTION_RECORD, void *, PCONTEXT,
3535

3636
#if __has_feature(ptrauth_restricted_intptr_qualifier)
3737
#define __ptrauth_gcc_personality_intptr(key, addressDiscriminated, \
38-
discriminator) \
38+
discriminator) \
3939
__ptrauth_restricted_intptr(key, addressDiscriminated, discriminator)
4040
#else
4141
#define __ptrauth_gcc_personality_intptr(key, addressDiscriminated, \
42-
discriminator) \
42+
discriminator) \
4343
__ptrauth(key, addressDiscriminated, discriminator)
4444
#endif
4545
#else
@@ -49,25 +49,30 @@ EXCEPTION_DISPOSITION _GCC_specific_handler(PEXCEPTION_RECORD, void *, PCONTEXT,
4949
#define __ptrauth_gcc_personality_func_key ptrauth_key_function_pointer
5050

5151
// ptrauth_string_discriminator("__gcc_personality_v0'funcStart") == 0xDFEB
52-
#define __ptrauth_gcc_personality_func_start \
53-
__ptrauth_gcc_personality_intptr(__ptrauth_gcc_personality_func_key, 1, 0xDFEB)
52+
#define __ptrauth_gcc_personality_func_start \
53+
__ptrauth_gcc_personality_intptr(__ptrauth_gcc_personality_func_key, 1, \
54+
0xDFEB)
5455

5556
// ptrauth_string_discriminator("__gcc_personality_v0'start") == 0x52DC
56-
#define __ptrauth_gcc_personality_start \
57-
__ptrauth_gcc_personality_intptr(__ptrauth_gcc_personality_func_key, 1, 0x52DC)
57+
#define __ptrauth_gcc_personality_start \
58+
__ptrauth_gcc_personality_intptr(__ptrauth_gcc_personality_func_key, 1, \
59+
0x52DC)
5860

5961
// ptrauth_string_discriminator("__gcc_personality_v0'length") == 0xFFF7
60-
#define __ptrauth_gcc_personality_length \
61-
__ptrauth_gcc_personality_intptr(__ptrauth_gcc_personality_func_key, 1, 0xFFF7)
62+
#define __ptrauth_gcc_personality_length \
63+
__ptrauth_gcc_personality_intptr(__ptrauth_gcc_personality_func_key, 1, \
64+
0xFFF7)
6265

63-
// ptrauth_string_discriminator("__gcc_personality_v0'landingPadOffset") == 0x6498
64-
#define __ptrauth_gcc_personality_lpoffset \
65-
__ptrauth_gcc_personality_intptr(__ptrauth_gcc_personality_func_key, 1, 0x6498)
66+
// ptrauth_string_discriminator("__gcc_personality_v0'landingPadOffset") ==
67+
// 0x6498
68+
#define __ptrauth_gcc_personality_lpoffset \
69+
__ptrauth_gcc_personality_intptr(__ptrauth_gcc_personality_func_key, 1, \
70+
0x6498)
6671

6772
// ptrauth_string_discriminator("__gcc_personality_v0'landingPad") == 0xA134
6873
#define __ptrauth_gcc_personality_lpad_disc 0xA134
69-
#define __ptrauth_gcc_personality_lpad \
70-
__ptrauth_gcc_personality_intptr(__ptrauth_gcc_personality_func_key, 1, \
74+
#define __ptrauth_gcc_personality_lpad \
75+
__ptrauth_gcc_personality_intptr(__ptrauth_gcc_personality_func_key, 1, \
7176
__ptrauth_gcc_personality_lpad_disc)
7277

7378
// Pointer encodings documented at:
@@ -246,7 +251,7 @@ COMPILER_RT_ABI _Unwind_Reason_Code __gcc_personality_v0(
246251

247252
uintptr_t pc = (uintptr_t)_Unwind_GetIP(context) - 1;
248253
uintptr_t __ptrauth_gcc_personality_func_start funcStart =
249-
(uintptr_t)_Unwind_GetRegionStart(context);
254+
(uintptr_t)_Unwind_GetRegionStart(context);
250255
uintptr_t pcOffset = pc - funcStart;
251256

252257
// Parse LSDA header.
@@ -266,11 +271,11 @@ COMPILER_RT_ABI _Unwind_Reason_Code __gcc_personality_v0(
266271
const uint8_t *p = callSiteTableStart;
267272
while (p < callSiteTableEnd) {
268273
uintptr_t __ptrauth_gcc_personality_start start =
269-
readEncodedPointer(&p, callSiteEncoding);
274+
readEncodedPointer(&p, callSiteEncoding);
270275
size_t __ptrauth_gcc_personality_length length =
271-
readEncodedPointer(&p, callSiteEncoding);
276+
readEncodedPointer(&p, callSiteEncoding);
272277
size_t __ptrauth_gcc_personality_lpoffset landingPadOffset =
273-
readEncodedPointer(&p, callSiteEncoding);
278+
readEncodedPointer(&p, callSiteEncoding);
274279
readULEB128(&p); // action value not used for C code
275280
if (landingPadOffset == 0)
276281
continue; // no landing pad for this entry
@@ -286,20 +291,16 @@ COMPILER_RT_ABI _Unwind_Reason_Code __gcc_personality_v0(
286291
funcStart + landingPadOffset;
287292
#if __has_feature(ptrauth_calls)
288293
uintptr_t stackPointer = _Unwind_GetGR(context, -2);
289-
const uintptr_t existingDiscriminator =
290-
ptrauth_blend_discriminator(&landingPad,
291-
__ptrauth_gcc_personality_lpad_disc);
294+
const uintptr_t existingDiscriminator = ptrauth_blend_discriminator(
295+
&landingPad, __ptrauth_gcc_personality_lpad_disc);
292296
// newIP is authenticated as if it were qualified with a pseudo qualifier
293297
// along the lines of:
294298
// __ptrauth(ptrauth_key_return_address, <stackPointer>, 0)
295299
// where the stack pointer is used in place of the strict storage
296300
// address.
297-
uintptr_t newIP =
298-
(uintptr_t)ptrauth_auth_and_resign(*(void **)&landingPad,
299-
__ptrauth_gcc_personality_func_key,
300-
existingDiscriminator,
301-
ptrauth_key_return_address,
302-
stackPointer);
301+
uintptr_t newIP = (uintptr_t)ptrauth_auth_and_resign(
302+
*(void **)&landingPad, __ptrauth_gcc_personality_func_key,
303+
existingDiscriminator, ptrauth_key_return_address, stackPointer);
303304
_Unwind_SetIP(context, newIP);
304305
#else
305306
_Unwind_SetIP(context, landingPad);

compiler-rt/test/ubsan/TestCases/TypeCheck/vptr-corrupted-vtable-itanium.cpp

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,6 @@
88

99
#if __has_feature(ptrauth_calls)
1010
#include <ptrauth.h>
11-
#else
1211
#endif
1312

1413
struct S {

0 commit comments

Comments
 (0)