gbranden pushed a commit to branch master
in repository groff.

commit 19d89b01d8bcb3675e7b198863fde5fc3dfb8c49
Author: G. Branden Robinson <[email protected]>
AuthorDate: Wed Nov 19 23:57:12 2025 -0600

    src/roff/troff/input.cpp: Add assertion (1/10).
    
    * src/roff/troff/input.cpp (do_overstrike): Invert sense of test and add
      assertion.
---
 ChangeLog                | 5 +++++
 src/roff/troff/input.cpp | 8 +++++++-
 2 files changed, 12 insertions(+), 1 deletion(-)

diff --git a/ChangeLog b/ChangeLog
index dbbc0ca1b..d058a0c78 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+2025-11-19  G. Branden Robinson <[email protected]>
+
+       * src/roff/troff/input.cpp (do_overstrike): Invert sense of test
+       and add assertion.
+
 2025-11-21  G. Branden Robinson <[email protected]>
 
        * src/roff/troff/input.cpp (read_title_parts): Slightly
diff --git a/src/roff/troff/input.cpp b/src/roff/troff/input.cpp
index a43ea2885..95cb032ab 100644
--- a/src/roff/troff/input.cpp
+++ b/src/roff/troff/input.cpp
@@ -1667,7 +1667,13 @@ node *do_overstrike() // \o
     }
     else {
       charinfo *ci = tok.get_charinfo(true /* required */);
-      if (ci != 0 /* nullptr */) {
+      if (0 /* nullptr */ == ci) {
+       assert(0 == "attempted to use token without charinfo in"
+              " overstrike escape sequence");
+       delete osnode;
+       return 0 /* nullptr */;
+      }
+      else {
        node *n = curenv->make_char_node(ci);
        if (n != 0 /* nullptr */)
          osnode->overstrike(n);

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

Reply via email to