gbranden pushed a commit to branch master
in repository groff.

commit a8b20742ae130abaf9d5080ec5d9923207a3bee5
Author: G. Branden Robinson <[email protected]>
AuthorDate: Fri Dec 5 05:34:59 2025 -0600

    [troff]: Add assertion.
    
    ...to check (what I believe to be) an invariant.
    
    * src/roff/troff/input.cpp (define_class_request): Do it.
---
 ChangeLog                | 5 +++++
 src/roff/troff/input.cpp | 4 ++++
 2 files changed, 9 insertions(+)

diff --git a/ChangeLog b/ChangeLog
index e838c257a..d6bb8dd71 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+2025-12-05  G. Branden Robinson <[email protected]>
+
+       * src/roff/troff/input.cpp (define_class_request): Add assertion
+       to check (what I believe to be) an invariant.
+
 2025-12-05  G. Branden Robinson <[email protected]>
 
        * src/roff/troff/input.cpp (define_class_request): Stop warning
diff --git a/src/roff/troff/input.cpp b/src/roff/troff/input.cpp
index a96ba43a0..08fb464f4 100644
--- a/src/roff/troff/input.cpp
+++ b/src/roff/troff/input.cpp
@@ -8733,6 +8733,10 @@ static void define_class_request()
     }
     if (tok.is_any_character())
       child1 = tok.get_charinfo(true /* required */);
+    else
+      // If we encountered a space or nonsense, we cannot be
+      // interpreting a range expression; there should be no "child1".
+      assert(0 /* nullptr */ == child1);
     tok.next();
     if (0 /* nullptr */ == child1) {
       if (!tok.is_newline())

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

Reply via email to