gbranden pushed a commit to branch master
in repository groff.
commit 2f97a5de69737421b38cfae473dc2f3335e0b9dd
Author: G. Branden Robinson <[email protected]>
AuthorDate: Tue Aug 13 08:24:02 2024 -0500
src/roff/troff/node.cpp: Add type size `assert()`.
* src/roff/troff/node.cpp (troff_output_file::flush_tbuf): Add
assertion: the type size should never be negative.
---
ChangeLog | 5 +++++
src/roff/troff/node.cpp | 1 +
2 files changed, 6 insertions(+)
diff --git a/ChangeLog b/ChangeLog
index 483918e64..cfe2700b9 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+2024-08-13 G. Branden Robinson <[email protected]>
+
+ * src/roff/troff/node.cpp (troff_output_file::flush_tbuf): Add
+ assertion: the type size should never be negative.
+
2024-08-13 G. Branden Robinson <[email protected]>
* src/include/symbol.h (class symbol): Boolify `is_null()` and
diff --git a/src/roff/troff/node.cpp b/src/roff/troff/node.cpp
index 12c028283..5236ccb77 100644
--- a/src/roff/troff/node.cpp
+++ b/src/roff/troff/node.cpp
@@ -1039,6 +1039,7 @@ void troff_output_file::flush_tbuf()
put(' ');
}
check_output_limits(hpos, vpos);
+ assert(current_size > 0);
check_output_limits(hpos, vpos - current_size);
for (int i = 0; i < tbuf_len; i++)
_______________________________________________
Groff-commit mailing list
[email protected]
https://lists.gnu.org/mailman/listinfo/groff-commit