Re: [HACKERS] [PATCH] work_mem calculation possible overflow

2013-12-28 Thread Tom Lane
David Rowley writes: > I was just looking through a few of the warnings flagged up by PVS Studio. > I found some warnings around some calculations that were doing work_mem * > 1024L and comparing that to a double. On windows 64 sizeof(long) is 4 bytes. > Currently work_mem's maximum value is INT_M

[HACKERS] [PATCH] work_mem calculation possible overflow

2013-12-27 Thread David Rowley
I was just looking through a few of the warnings flagged up by PVS Studio. I found some warnings around some calculations that were doing work_mem * 1024L and comparing that to a double. On windows 64 sizeof(long) is 4 bytes. Currently work_mem's maximum value is INT_MAX / 1024, so this should not