diff options
author | Denys Vlasenko <vda.linux@googlemail.com> | 2019-01-03 23:34:36 +0100 |
---|---|---|
committer | Denys Vlasenko <vda.linux@googlemail.com> | 2019-01-03 23:34:36 +0100 |
commit | 96b5ec10fb8abdb8050a6af87330e6cf3d881d5a (patch) | |
tree | 8fbc53fb1f7057170415adf6516319dcba2e7cdc /testsuite | |
parent | ae6c44ea15f4b73e8e5532f6392d1e6ce8c087e7 (diff) | |
download | busybox-96b5ec10fb8abdb8050a6af87330e6cf3d881d5a.tar.gz |
bc: fix "...; return}" to work, disallow "return ()"
function old new delta
zbc_parse_expr 24 1865 +1841
zbc_parse_stmt_possibly_auto 1425 1413 -12
bc_parse_expr_empty_ok 1843 - -1843
------------------------------------------------------------------------------
(add/remove: 0/1 grow/shrink: 1/1 up/down: 1841/-1855) Total: -14 bytes
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
Diffstat (limited to 'testsuite')
-rwxr-xr-x | testsuite/bc.tests | 5 | ||||
-rw-r--r-- | testsuite/bc_misc1.bc | 4 |
2 files changed, 6 insertions, 3 deletions
diff --git a/testsuite/bc.tests b/testsuite/bc.tests index 7795183a7..0a8222be6 100755 --- a/testsuite/bc.tests +++ b/testsuite/bc.tests @@ -103,6 +103,11 @@ testing "bc for (;;) {break}" \ "2\n9\n" \ "" "for (;;) {2;break}; 9" +testing "bc define {return}" \ + "bc" \ + "0\n9\n" \ + "" "define w() {return}\nw();9" + testing "bc define auto" \ "bc" \ "8\n9\n" \ diff --git a/testsuite/bc_misc1.bc b/testsuite/bc_misc1.bc index 7e9d96604..f666d701a 100644 --- a/testsuite/bc_misc1.bc +++ b/testsuite/bc_misc1.bc @@ -4,9 +4,7 @@ define x(x) { define y() { return; } -define z() { - return (); -} +define z() {return} scale = 0 x=2 x[0]=3 |