diff options
| author | rillig <rillig@NetBSD.org> | 2021-10-29 19:39:32 +0000 |
|---|---|---|
| committer | rillig <rillig@NetBSD.org> | 2021-10-29 19:39:32 +0000 |
| commit | afb49667c1912fb361b722158a0fce4c31e82f59 (patch) | |
| tree | 60c215e446f362d1e4f4abcb9d7ce093a86cdb9f /tests/usr.bin/indent/t_errors.sh | |
| parent | b0b5ed56dfd7c120960c8db5aa5b88ada23d8f38 (diff) | |
tests/indent: demonstrate segmentation fault in search_stmt_comment
Diffstat (limited to 'tests/usr.bin/indent/t_errors.sh')
| -rw-r--r-- | tests/usr.bin/indent/t_errors.sh | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/tests/usr.bin/indent/t_errors.sh b/tests/usr.bin/indent/t_errors.sh index 320971aacfc..5d04a7f1ffe 100644 --- a/tests/usr.bin/indent/t_errors.sh +++ b/tests/usr.bin/indent/t_errors.sh @@ -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' } |
