|
Mark Wielaard |
652537 |
From a93b0f5c9f0abef6efb5413df9e98b047a2a9a46 Mon Sep 17 00:00:00 2001
|
|
Mark Wielaard |
652537 |
From: Jan Kratochvil <jan.kratochvil@redhat.com>
|
|
Mark Wielaard |
652537 |
Date: Mon, 17 Aug 2020 16:56:56 +0200
|
|
Mark Wielaard |
652537 |
Subject: [PATCH 1/6] [NFC] debugedit: Protect macro arguments by parentheses
|
|
Mark Wielaard |
652537 |
|
|
Mark Wielaard |
652537 |
---
|
|
Mark Wielaard |
652537 |
tools/debugedit.c | 14 +++++++-------
|
|
Mark Wielaard |
652537 |
1 file changed, 7 insertions(+), 7 deletions(-)
|
|
Mark Wielaard |
652537 |
|
|
Mark Wielaard |
652537 |
diff --git a/tools/debugedit.c b/tools/debugedit.c
|
|
Mark Wielaard |
652537 |
index 6bea88551..a351adec8 100644
|
|
Mark Wielaard |
652537 |
--- a/tools/debugedit.c
|
|
Mark Wielaard |
652537 |
+++ b/tools/debugedit.c
|
|
Mark Wielaard |
652537 |
@@ -233,7 +233,7 @@ typedef struct
|
|
Mark Wielaard |
652537 |
int shift = 0; \
|
|
Mark Wielaard |
652537 |
do \
|
|
Mark Wielaard |
652537 |
{ \
|
|
Mark Wielaard |
652537 |
- c = *ptr++; \
|
|
Mark Wielaard |
652537 |
+ c = *(ptr)++; \
|
|
Mark Wielaard |
652537 |
ret |= (c & 0x7f) << shift; \
|
|
Mark Wielaard |
652537 |
shift += 7; \
|
|
Mark Wielaard |
652537 |
} while (c & 0x80); \
|
|
Mark Wielaard |
652537 |
@@ -251,7 +251,7 @@ typedef struct
|
|
Mark Wielaard |
652537 |
valv >>= 7; \
|
|
Mark Wielaard |
652537 |
if (valv) \
|
|
Mark Wielaard |
652537 |
c |= 0x80; \
|
|
Mark Wielaard |
652537 |
- *ptr++ = c; \
|
|
Mark Wielaard |
652537 |
+ *(ptr)++ = c; \
|
|
Mark Wielaard |
652537 |
} \
|
|
Mark Wielaard |
652537 |
while (valv); \
|
|
Mark Wielaard |
652537 |
})
|
|
Mark Wielaard |
652537 |
@@ -311,7 +311,7 @@ strptr (DSO *dso, int sec, off_t offset)
|
|
Mark Wielaard |
652537 |
}
|
|
Mark Wielaard |
652537 |
|
|
Mark Wielaard |
652537 |
|
|
Mark Wielaard |
652537 |
-#define read_8(ptr) *ptr++
|
|
Mark Wielaard |
652537 |
+#define read_8(ptr) *(ptr)++
|
|
Mark Wielaard |
652537 |
|
|
Mark Wielaard |
652537 |
#define read_16(ptr) ({ \
|
|
Mark Wielaard |
652537 |
uint16_t ret = do_read_16 (ptr); \
|
|
Mark Wielaard |
652537 |
@@ -328,13 +328,13 @@ strptr (DSO *dso, int sec, off_t offset)
|
|
Mark Wielaard |
652537 |
REL *relptr, *relend;
|
|
Mark Wielaard |
652537 |
int reltype;
|
|
Mark Wielaard |
652537 |
|
|
Mark Wielaard |
652537 |
-#define do_read_32_relocated(ptr) ({ \
|
|
Mark Wielaard |
652537 |
- uint32_t dret = do_read_32 (ptr); \
|
|
Mark Wielaard |
652537 |
+#define do_read_32_relocated(xptr) ({ \
|
|
Mark Wielaard |
652537 |
+ uint32_t dret = do_read_32 (xptr); \
|
|
Mark Wielaard |
652537 |
if (relptr) \
|
|
Mark Wielaard |
652537 |
{ \
|
|
Mark Wielaard |
652537 |
- while (relptr < relend && relptr->ptr < ptr) \
|
|
Mark Wielaard |
652537 |
+ while (relptr < relend && relptr->ptr < (xptr)) \
|
|
Mark Wielaard |
652537 |
++relptr; \
|
|
Mark Wielaard |
652537 |
- if (relptr < relend && relptr->ptr == ptr) \
|
|
Mark Wielaard |
652537 |
+ if (relptr < relend && relptr->ptr == (xptr)) \
|
|
Mark Wielaard |
652537 |
{ \
|
|
Mark Wielaard |
652537 |
if (reltype == SHT_REL) \
|
|
Mark Wielaard |
652537 |
dret += relptr->addend; \
|
|
Mark Wielaard |
652537 |
--
|
|
Mark Wielaard |
652537 |
2.18.4
|
|
Mark Wielaard |
652537 |
|