gbranden pushed a commit to branch master
in repository groff.
commit 4ccff2d96fd0b22e79d43dcc2bfe705ab02a7e1e
Author: G. Branden Robinson <[email protected]>
AuthorDate: Fri Nov 21 22:08:19 2025 -0600
src/roff/troff/node.cpp: Add assertion (10/10).
* src/roff/troff/node.cpp (remove_font_specific_character): Add
assertion.
---
ChangeLog | 5 ++++-
src/roff/troff/node.cpp | 5 ++++-
2 files changed, 8 insertions(+), 2 deletions(-)
diff --git a/ChangeLog b/ChangeLog
index b8ffb2bc9..a8b6ce370 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,12 +1,15 @@
2025-11-19 G. Branden Robinson <[email protected]>
+ * src/roff/troff/input.cpp (define_character, get_line_arg)
+ (do_translate):
+ * src/roff/troff/node.cpp (remove_font_specific_character): Add
+ assertions.
* src/roff/troff/input.cpp (do_overstrike, do_bracket)
(token::description)
(encode_special_character_for_device_output)
(set_character_flags_request): Invert sense of test and add
assertion.
(token::next): Add assertions to `\z` escape sequence handler.
- (define_character, get_line_arg, do_translate): Add assertions.
(token:description): Split conditional to accommodate assertion.
(encode_special_character_for_device_output): Lift assignment
out of conditional branch since a null pointer check now guards
diff --git a/src/roff/troff/node.cpp b/src/roff/troff/node.cpp
index 16766cd2d..6d2d22a91 100644
--- a/src/roff/troff/node.cpp
+++ b/src/roff/troff/node.cpp
@@ -7050,8 +7050,11 @@ static void remove_font_specific_character()
while (!tok.is_newline() && !tok.is_eof()) {
if (!tok.is_space() && !tok.is_tab()) {
charinfo *s = tok.get_charinfo(true /* required */);
- if (0 /* nullptr */ == s)
+ if (0 /* nullptr */ == s) {
+ assert(0 == "attempted to use token without charinfo in"
+ " font-specific character removal request");
break;
+ }
string gl(f.contents());
gl += ' ';
gl += s->nm.contents();
_______________________________________________
groff-commit mailing list
[email protected]
https://lists.gnu.org/mailman/listinfo/groff-commit