Skip to content

Commit 236d1b0

Browse files
icmccormobraunsdorf
authored andcommitted
Fixed formatting of casts.
1 parent bfcb2a1 commit 236d1b0

File tree

1 file changed

+14
-16
lines changed

1 file changed

+14
-16
lines changed

compiler-rt/lib/bsan/bsan_interceptors.h

Lines changed: 14 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -39,42 +39,40 @@ void InitializeBsanInterceptors();
3939
#define BSAN_MEMCPY_IMPL(ctx, to, from, size) \
4040
do { \
4141
if (LIKELY(BsanInited())) { \
42-
uptr __to = (uptr)to; \
43-
uptr __from = (uptr)from; \
44-
BsanShadowCopy(__to, __from, size); \
42+
uptr __to = (uptr)(to); \
43+
uptr __from = (uptr)(from); \
44+
BsanShadowCopy(__to, __from, size); \
4545
} \
4646
return REAL(memcpy)(to, from, size); \
4747
} while (0)
4848
#define BSAN_MEMSET_IMPL(ctx, block, c, size) \
4949
do { \
5050
if (LIKELY(BsanInited())) { \
5151
BSAN_WRITE_RANGE(ctx, block, size); \
52-
} else { \
53-
return internal_memset(block, c, size); \
5452
} \
5553
return REAL(memset)(block, c, size); \
5654
} while (0)
5755
#define BSAN_MEMMOVE_IMPL(ctx, to, from, size) \
5856
do { \
5957
if (LIKELY(BsanInited())) { \
60-
uptr __to = (uptr)to; \
61-
uptr __from = (uptr)from; \
58+
uptr __to = (uptr)(to); \
59+
uptr __from = (uptr)(from); \
6260
BsanShadowCopy(__to, __from, size); \
6361
} \
6462
return internal_memmove(to, from, size); \
6563
} while (0)
66-
#define BSAN_WRITE_RANGE(ctx, ptr, size) \
64+
#define BSAN_WRITE_RANGE(ctx, offset, size) \
6765
do { \
68-
uptr __ptr = (uptr)ptr; \
69-
uptr __size = (uptr)size; \
70-
BsanShadowClear(__ptr, __size); \
71-
} while (false)
72-
#define BSAN_READ_RANGE(ctx, ptr, size) \
66+
uptr __offset = (uptr)(offset); \
67+
uptr __size = (uptr)(size); \
68+
BsanShadowClear(__offset, __size); \
69+
} while (0)
70+
#define BSAN_READ_RANGE(ctx, offset, size) \
7371
do { \
74-
uptr __offset = (uptr)ptr; \
75-
uptr __size = (uptr)size; \
72+
uptr __offset = (uptr)(offset); \
73+
uptr __size = (uptr)(size); \
7674
BsanRead(0, __offset, __size); \
77-
} while (false)
75+
} while (0)
7876

7977
DECLARE_REAL(void *, memcpy, void *to, const void *from, uptr size)
8078
DECLARE_REAL(void *, memset, void *block, int c, uptr size)

0 commit comments

Comments
 (0)