mirror of
https://github.com/postgres/postgres.git
synced 2025-07-07 00:36:50 +03:00
Change internal integer representation of Value node
A Value node would store an integer as a long. This causes needless portability risks, as long can be of varying sizes. Change it to use int instead. All code using this was already careful to only store 32-bit values anyway. Reviewed-by: Michael Paquier <michael@paquier.xyz>
This commit is contained in:
@ -732,12 +732,9 @@ cppline {space}*#([^i][A-Za-z]*|{if}|{ifdef}|{ifndef}|{import})((\/\*[^*/]*\*+
|
||||
|
||||
errno = 0;
|
||||
val = strtol((char *)yytext, &endptr,10);
|
||||
if (*endptr != '\0' || errno == ERANGE
|
||||
#ifdef HAVE_LONG_INT_64
|
||||
/* if long > 32 bits, check for overflow of int4 */
|
||||
|| val != (long) ((int32) val)
|
||||
#endif
|
||||
)
|
||||
if (*endptr != '\0' || errno == ERANGE ||
|
||||
/* check for overflow of int */
|
||||
val != (int) val)
|
||||
{
|
||||
errno = 0;
|
||||
base_yylval.str = mm_strdup(yytext);
|
||||
|
Reference in New Issue
Block a user