mirror of
https://github.com/postgres/postgres.git
synced 2025-07-28 23:42:10 +03:00
Add parentheses to macros when args are used in computations. Without
them, the executation behavior could be unexpected.
This commit is contained in:
@ -386,12 +386,12 @@ typedef struct
|
||||
} INFIX;
|
||||
|
||||
#define RESIZEBUF(inf,addsize) \
|
||||
while( ( inf->cur - inf->buf ) + addsize + 1 >= inf->buflen ) \
|
||||
while( ( (inf)->cur - (inf)->buf ) + (addsize) + 1 >= (inf)->buflen ) \
|
||||
{ \
|
||||
int4 len = inf->cur - inf->buf; \
|
||||
inf->buflen *= 2; \
|
||||
inf->buf = (char*) repalloc( (void*)inf->buf, inf->buflen ); \
|
||||
inf->cur = inf->buf + len; \
|
||||
int4 len = (inf)->cur - (inf)->buf; \
|
||||
(inf)->buflen *= 2; \
|
||||
(inf)->buf = (char*) repalloc( (void*)(inf)->buf, (inf)->buflen ); \
|
||||
(inf)->cur = (inf)->buf + len; \
|
||||
}
|
||||
|
||||
/*
|
||||
|
Reference in New Issue
Block a user