indent-2.2.12 bug on large files

Michal Kalderon <[email protected]> Sun, 3 Jan 2021 14:13:02 +0000
Newsgroups gmane.comp.gnu.indent.bugs
Message-ID <MN2PR18MB31828A9EE5D066B26F78401CA1D31@MN2PR18MB3182.namprd18.prod.outlook.com>
Hi,

When running indent version 2.2.12 on a large file we get a failure in xrea=
lloc function.
Root cause:

handletoken.c
func need_chars
bp->size =3D ((current_size + needed) & (size_t)~1023);

if the current size is "0" the result is "0" instead of being 1024 ( rounde=
d up as in version 2.2.11 )
The solution is to use the ROUND_UP macro

Thanks,
Michal