From d3480dd58211d9d8c06ec7ef00089262603003ff Mon Sep 17 00:00:00 2001 From: Denys Vlasenko Date: Wed, 14 Jul 2021 14:33:37 +0200 Subject: awk: disallow break/continue outside of loops function old new delta .rodata 104139 104186 +47 chain_group 610 633 +23 ------------------------------------------------------------------------------ (add/remove: 0/0 grow/shrink: 2/0 up/down: 70/0) Total: 70 bytes Signed-off-by: Denys Vlasenko --- testsuite/awk.tests | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) (limited to 'testsuite') diff --git a/testsuite/awk.tests b/testsuite/awk.tests index 3cddb4dd4..f53b1efe2 100755 --- a/testsuite/awk.tests +++ b/testsuite/awk.tests @@ -379,19 +379,14 @@ testing "awk -e and ARGC" \ "" SKIP= -# The examples are in fact not valid awk programs (break/continue -# can only be used inside loops). -# But we do accept them outside of loops. -# We had a bug with misparsing "break ; else" sequence. -# Test that *that* bug is fixed, using simplest possible scripts: testing "awk break" \ "awk -f - 2>&1; echo \$?" \ - "0\n" \ + "awk: -:1: 'break' not in a loop\n1\n" \ "" \ 'BEGIN { if (1) break; else a = 1 }' testing "awk continue" \ "awk -f - 2>&1; echo \$?" \ - "0\n" \ + "awk: -:1: 'continue' not in a loop\n1\n" \ "" \ 'BEGIN { if (1) continue; else a = 1 }' -- cgit v1.2.1