gbranden pushed a commit to branch master
in repository groff.
commit 9ca5baca863ee8d4cbd923d4f1b5f3caa04f2903
Author: G. Branden Robinson <[email protected]>
AuthorDate: Fri Nov 21 22:06:03 2025 -0600
src/roff/troff/input.cpp: Add assertion (9/10).
* src/roff/troff/input.cpp (set_character_flags_request): Invert sense
of test and add assertion.
---
ChangeLog | 5 +++--
src/roff/troff/input.cpp | 5 ++++-
2 files changed, 7 insertions(+), 3 deletions(-)
diff --git a/ChangeLog b/ChangeLog
index b4f88b0c1..b8ffb2bc9 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -2,8 +2,9 @@
* src/roff/troff/input.cpp (do_overstrike, do_bracket)
(token::description)
- (encode_special_character_for_device_output): Invert sense of
- test and add assertion.
+ (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.
diff --git a/src/roff/troff/input.cpp b/src/roff/troff/input.cpp
index d200306b4..f67e96adb 100644
--- a/src/roff/troff/input.cpp
+++ b/src/roff/troff/input.cpp
@@ -8483,7 +8483,10 @@ static void set_character_flags_request()
}
while (has_arg()) {
charinfo *ci = tok.get_charinfo(true /* required */);
- if (ci != 0 /* nullptr */) {
+ if (0 /* nullptr */ == ci)
+ assert(0 == "attempted to use token without charinfo in"
+ " character flags assignment request");
+ else {
charinfo *tem = ci->get_translation();
if (tem != 0 /* nullptr */)
ci = tem;
_______________________________________________
groff-commit mailing list
[email protected]
https://lists.gnu.org/mailman/listinfo/groff-commit