diagnostics: fix invalid error message indentation

https://lists.gnu.org/archive/html/bison-patches/2019-08/msg00007.html

When Bison is started with a flag that suppresses warning messages, the
error_message() function can produce a few gigabytes of indentation
because of a dangling pointer.

* src/complain.c (error_message): Don't reset indent_ptr here, but...
(complain_indent): here.
* tests/diagnostics.at (Indentation with message suppression): Check
this case.
This commit is contained in:
László Várady
2019-08-09 14:24:14 +02:00
committed by Akim Demaille
parent d7cf3f5b18
commit 9145bd0b61
4 changed files with 35 additions and 1 deletions

3
NEWS
View File

@@ -4,6 +4,9 @@ GNU Bison NEWS
** Bug fixes
In some cases, when warnings are disabled, bison could emit tons of white
spaces as diagnostics.
In Java, %define api.prefix was ignored. It now behaves as expected.
** New features