gbranden pushed a commit to branch master
in repository groff.
commit 14ede50be7203ccc3807646d44c48b855b655105
Author: G. Branden Robinson <[email protected]>
AuthorDate: Fri Nov 21 21:44:35 2025 -0600
src/roff/troff/input.cpp: Add assertions (5/10).
* src/roff/troff/input.cpp (token::description): Invert sense of test
and add assertion. Split conditional to accommodate assertion.
---
ChangeLog | 5 +++--
src/roff/troff/input.cpp | 6 +++++-
2 files changed, 8 insertions(+), 3 deletions(-)
diff --git a/ChangeLog b/ChangeLog
index 133f9306b..639bb8a82 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,9 +1,10 @@
2025-11-19 G. Branden Robinson <[email protected]>
- * src/roff/troff/input.cpp (do_overstrike, do_bracket): Invert
- sense of test and add assertion.
+ * src/roff/troff/input.cpp (do_overstrike, do_bracket)
+ (token::description): Invert sense of test and add assertion.
(token::next): Add assertions to `\z` escape sequence handler.
(define_character): Add assertion.
+ (token:description): Split conditional to accommodate assertion.
2025-11-21 G. Branden Robinson <[email protected]>
diff --git a/src/roff/troff/input.cpp b/src/roff/troff/input.cpp
index 636d1d849..91cabb841 100644
--- a/src/roff/troff/input.cpp
+++ b/src/roff/troff/input.cpp
@@ -2982,7 +2982,11 @@ const char *token::description()
static const char character_class[] = "character class";
const char *ctype = special_character;
charinfo *ci = get_charinfo();
- if ((ci != 0 /* nullptr */) && ci->is_class())
+ if (0 /* nullptr */ == ci) {
+ assert(0 == "attempted to process token without charinfo");
+ return "impossible character";
+ }
+ else if (ci->is_class())
ctype = character_class;
(void) snprintf(buf, maxstr, "%s %c%s%c", ctype, qc, sc, qc);
return buf;
_______________________________________________
groff-commit mailing list
[email protected]
https://lists.gnu.org/mailman/listinfo/groff-commit