]> git.ipfire.org Git - thirdparty/elfutils.git/commitdiff
Fix REALLOC macro
authorPetr Machata <pmachata@redhat.com>
Sat, 31 Jan 2009 23:28:57 +0000 (00:28 +0100)
committerPetr Machata <pmachata@redhat.com>
Sat, 31 Jan 2009 23:28:57 +0000 (00:28 +0100)
src/dwarflint.c

index 2f8e7f06f6ea744901b53836e43a08c047294e53..f8c04250907e68d5986ffc319ad21b8bfaa7ce20 100644 (file)
@@ -359,14 +359,15 @@ parse_opt (int key, char *arg __attribute__ ((unused)),
 
 #define REALLOC(A, BUF)                                                \
   do {                                                         \
-    if (A->size == A->alloc)                                   \
+    typeof ((A)) _a = (A);                                     \
+    if (_a->size == _a->alloc)                                 \
       {                                                                \
-       if (A->alloc == 0)                                      \
-         A->alloc = 8;                                         \
+       if (_a->alloc == 0)                                     \
+         _a->alloc = 8;                                        \
        else                                                    \
-         A->alloc *= 2;                                        \
-       A->BUF = xrealloc (A->BUF,                              \
-                          sizeof (*A->BUF) * A->alloc);        \
+         _a->alloc *= 2;                                       \
+       _a->BUF = xrealloc (_a->BUF,                            \
+                           sizeof (*_a->BUF) * _a->alloc);     \
       }                                                                \
   } while (0)