Module Name:    src
Committed By:   rillig
Date:           Fri Oct 29 19:39:32 UTC 2021

Modified Files:
        src/tests/usr.bin/indent: t_errors.sh

Log Message:
tests/indent: demonstrate segmentation fault in search_stmt_comment


To generate a diff of this commit:
cvs rdiff -u -r1.11 -r1.12 src/tests/usr.bin/indent/t_errors.sh

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/tests/usr.bin/indent/t_errors.sh
diff -u src/tests/usr.bin/indent/t_errors.sh:1.11 src/tests/usr.bin/indent/t_errors.sh:1.12
--- src/tests/usr.bin/indent/t_errors.sh:1.11	Fri Oct 29 16:54:51 2021
+++ src/tests/usr.bin/indent/t_errors.sh	Fri Oct 29 19:39:32 2021
@@ -1,5 +1,5 @@
 #! /bin/sh
-# $NetBSD: t_errors.sh,v 1.11 2021/10/29 16:54:51 rillig Exp $
+# $NetBSD: t_errors.sh,v 1.12 2021/10/29 19:39:32 rillig Exp $
 #
 # Copyright (c) 2021 The NetBSD Foundation, Inc.
 # All rights reserved.
@@ -408,6 +408,14 @@ unbalanced_parentheses_3_body()
 	    "$indent" code.c
 }
 
+atf_test_case 'search_stmt_comment_segv'
+search_stmt_comment_segv_body()
+{
+	printf '{if(expr\n)/*c*/;}\n' > code.c
+
+	atf_check -s 'signal' \
+	    "$indent" code.c -st
+}
 
 atf_init_test_cases()
 {
@@ -440,4 +448,5 @@ atf_init_test_cases()
 	atf_add_test_case 'unbalanced_parentheses_1'
 	atf_add_test_case 'unbalanced_parentheses_2'
 	atf_add_test_case 'unbalanced_parentheses_3'
+	atf_add_test_case 'search_stmt_comment_segv'
 }

Reply via email to