gbranden pushed a commit to branch master
in repository groff.

commit c5bc665e4d943e4e7eb1649b13dec5ec6debc190
Author: G. Branden Robinson <[email protected]>
AuthorDate: Sat Oct 17 12:19:00 2026 -0500

    [troff]: Add `NDEBUG` fallback to `lookup_request()`.
    
    * src/roff/troff/input.cpp (lookup_request) [NDEBUG]: Return null
      pointer `request_or_macro` if the `nm` `symbol` passed in `is_null()`.
---
 ChangeLog                | 8 ++++++++
 src/roff/troff/input.cpp | 2 ++
 2 files changed, 10 insertions(+)

diff --git a/ChangeLog b/ChangeLog
index 1a6db698a..1dc31f306 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,11 @@
+2026-10-17  G. Branden Robinson <[email protected]>
+
+       [troff]: Add `NDEBUG` fallback to `lookup_request()`.
+
+       * src/roff/troff/input.cpp (lookup_request) [NDEBUG]: Return
+       null pointer `request_or_macro` if the `nm` `symbol` passed in
+       `is_null()`.
+
 2026-10-17  G. Branden Robinson <[email protected]>
 
        [troff]: Fix code style nits.
diff --git a/src/roff/troff/input.cpp b/src/roff/troff/input.cpp
index c84850af3..a3bba53a0 100644
--- a/src/roff/troff/input.cpp
+++ b/src/roff/troff/input.cpp
@@ -10618,6 +10618,8 @@ void init_request(const char *s, REQUEST_FUNCP f)
 static request_or_macro *lookup_request(symbol nm)
 {
   assert(!nm.is_null());
+  if (nm.is_null()) // NDEBUG
+    return 0 /* nullptr*/;
   request_or_macro *p
     = static_cast<request_or_macro *>(request_dictionary.lookup(nm));
   if (0 /* nullptr */ == p) {

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

Reply via email to