new regression test for roff.c rev. 1.270:
authorschwarze <schwarze@openbsd.org>
Sun, 22 Oct 2023 16:54:19 +0000 (16:54 +0000)
committerschwarze <schwarze@openbsd.org>
Sun, 22 Oct 2023 16:54:19 +0000 (16:54 +0000)
infinite recursion in macro argument expansion

regress/usr.bin/mandoc/roff/args/Makefile
regress/usr.bin/mandoc/roff/args/infrec.in [new file with mode: 0644]
regress/usr.bin/mandoc/roff/args/infrec.out_ascii [new file with mode: 0644]
regress/usr.bin/mandoc/roff/args/infrec.out_lint [new file with mode: 0644]

index c1f0901..49aa653 100644 (file)
@@ -1,6 +1,7 @@
-# $OpenBSD: Makefile,v 1.5 2023/10/21 17:28:01 schwarze Exp $
+# $OpenBSD: Makefile,v 1.6 2023/10/22 16:54:19 schwarze Exp $
 
-REGRESS_TARGETS = roff man mdoc esc
-LINT_TARGETS   = roff man mdoc
+REGRESS_TARGETS = roff man mdoc esc infrec
+LINT_TARGETS   = roff man mdoc infrec
+SKIP_GROFF     = infrec
 
 .include <bsd.regress.mk>
diff --git a/regress/usr.bin/mandoc/roff/args/infrec.in b/regress/usr.bin/mandoc/roff/args/infrec.in
new file mode 100644 (file)
index 0000000..5935404
--- /dev/null
@@ -0,0 +1,10 @@
+.\" $OpenBSD: infrec.in,v 1.1 2023/10/22 16:54:19 schwarze Exp $
+.TH ARGS-INFREC 1 "October 22, 2023"
+.SH NAME
+args-infrec - infinite recursion in macro argument expansion
+.SH DESCRIPTION
+.ds mys first word
+.ds mys \\*[mys] another word
+initial text
+.RB prefix \\*[mys] postfix
+final text
diff --git a/regress/usr.bin/mandoc/roff/args/infrec.out_ascii b/regress/usr.bin/mandoc/roff/args/infrec.out_ascii
new file mode 100644 (file)
index 0000000..e619c08
--- /dev/null
@@ -0,0 +1,9 @@
+ARGS-INFREC(1)              General Commands Manual             ARGS-INFREC(1)
+
+N\bNA\bAM\bME\bE
+       args-infrec - infinite recursion in macro argument expansion
+
+D\bDE\bES\bSC\bCR\bRI\bIP\bPT\bTI\bIO\bON\bN
+       initial text prefixpostfix final text
+
+OpenBSD                        October 22, 2023                 ARGS-INFREC(1)
diff --git a/regress/usr.bin/mandoc/roff/args/infrec.out_lint b/regress/usr.bin/mandoc/roff/args/infrec.out_lint
new file mode 100644 (file)
index 0000000..1de6423
--- /dev/null
@@ -0,0 +1 @@
+mandoc: infrec.in:9:1: ERROR: input stack limit exceeded, infinite loop?