gbranden pushed a commit to branch master
in repository groff.

commit 17d7fe9166154dba735dd795c37da491a67429f2
Author: G. Branden Robinson <[email protected]>
AuthorDate: Fri Nov 21 21:45:45 2025 -0600

    src/roff/troff/input.cpp: Add assertion (6/10).
    
    * src/roff/troff/input.cpp (get_line_arg): Add assertion.
---
 ChangeLog                | 2 +-
 src/roff/troff/input.cpp | 3 +++
 2 files changed, 4 insertions(+), 1 deletion(-)

diff --git a/ChangeLog b/ChangeLog
index 639bb8a82..b432325f9 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -3,7 +3,7 @@
        * 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.
+       (define_character, get_line_arg): 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 91cabb841..b9bbf2c49 100644
--- a/src/roff/troff/input.cpp
+++ b/src/roff/troff/input.cpp
@@ -5962,6 +5962,9 @@ static bool get_line_arg(units *n, unsigned char si, 
charinfo **cip)
     if (!(start_token == tok
          && input_stack::get_level() == start_level)) {
       *cip = tok.get_charinfo(true /* required */);
+      if (0 /* nullptr */ == *cip)
+       assert(0 == "attempted to use token without charinfo in"
+              " line-drawing escape sequence");
       tok.next();
     }
     if (!(start_token == tok

_______________________________________________
groff-commit mailing list
[email protected]
https://lists.gnu.org/mailman/listinfo/groff-commit

Reply via email to