gbranden pushed a commit to branch master
in repository groff.

commit aa43b5e261a7b4fe3b09e6673f145b0e123faffa
Author: G. Branden Robinson <[email protected]>
AuthorDate: Tue Jun 23 14:02:44 2026 -0500

    [eqn]: Regression-test Savannah #68468.
    
    * src/preproc/eqn/tests/do-not-segv-on-excess-macro-arguments.sh: Do it.
    
    * src/preproc/eqn/eqn.am (eqn_TESTS): Run test.
    
    Test fails at this commit.
---
 ChangeLog                                          |  8 +++++
 src/preproc/eqn/eqn.am                             |  1 +
 .../tests/do-not-segv-on-excess-macro-arguments.sh | 35 ++++++++++++++++++++++
 3 files changed, 44 insertions(+)

diff --git a/ChangeLog b/ChangeLog
index 123c83a3f..7009605de 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,11 @@
+2026-06-23  G. Branden Robinson <[email protected]>
+
+       [eqn]: Regression-test Savannah #68468.
+
+       * src/preproc/eqn/tests/\
+       do-not-segv-on-excess-macro-arguments.sh: Do it.
+       * src/preproc/eqn/eqn.am (eqn_TESTS): Run test.
+
 2026-06-23  G. Branden Robinson <[email protected]>
 
        [eqn]: Add `lex_warning()` function.
diff --git a/src/preproc/eqn/eqn.am b/src/preproc/eqn/eqn.am
index e9ee945dc..2da17525f 100644
--- a/src/preproc/eqn/eqn.am
+++ b/src/preproc/eqn/eqn.am
@@ -81,6 +81,7 @@ maintainer-clean-eqn:
 
 eqn_TESTS = \
   src/preproc/eqn/tests/diagnostics-report-correct-line-numbers.sh \
+  src/preproc/eqn/tests/do-not-segv-on-excess-macro-arguments.sh \
   src/preproc/eqn/tests/neqn-finds-matching-eqn.sh \
   src/preproc/eqn/tests/neqn-smoke-test.sh \
   src/preproc/eqn/tests/parameters-can-be-set-and-reset.sh \
diff --git a/src/preproc/eqn/tests/do-not-segv-on-excess-macro-arguments.sh 
b/src/preproc/eqn/tests/do-not-segv-on-excess-macro-arguments.sh
new file mode 100755
index 000000000..80d79a4f8
--- /dev/null
+++ b/src/preproc/eqn/tests/do-not-segv-on-excess-macro-arguments.sh
@@ -0,0 +1,35 @@
+#!/bin/sh
+#
+# Copyright 2026 G. Branden Robinson
+#
+# This file is part of groff, the GNU roff typesetting system.
+#
+# groff is free software; you can redistribute it and/or modify it under
+# the terms of the GNU General Public License as published by the Free
+# Software Foundation, either version 3 of the License, or
+# (at your option) any later version.
+#
+# groff is distributed in the hope that it will be useful, but WITHOUT
+# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+# FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+# for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program. If not, see <http://www.gnu.org/licenses/>.
+
+eqn="${abs_top_builddir:-.}/eqn"
+
+# Regression-test Savannah #68468.
+
+input='.
+.EQ
+define derp ! $1 + $2 + $3 + $4 + $5 + $6 + $7 + $8 + $9 !
+addup derp(1, 2, 3, 4, 5, 6, 7, 8, 9, 10)
+.EN
+.'
+
+output=$(echo "$input" | "$eqn" -R)
+printf '%s\n' "$output"
+printf '%s\n' "$output" | grep -Fqx '.EN'
+
+# vim:set autoindent expandtab shiftwidth=4 tabstop=4 textwidth=72:

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

Reply via email to