Permalink
Browse files

Fix bug in last commit: exit in function call is OK.

This made the osh-runtime benchmarks fail.  Make the error stand out
more.
  • Loading branch information...
Andy Chu
Andy Chu committed Jan 22, 2018
1 parent 782a684 commit 24ef5fccd492c44847e1719f656d766cfb27d220
Showing with 7 additions and 3 deletions.
  1. +1 −1 benchmarks/osh-runtime.sh
  2. +3 −1 core/cmd_exec.py
  3. +3 −1 spec/builtins.test.sh
@@ -246,7 +246,7 @@ measure() {
# An empty pattern matches every line.
time egrep "$pattern" $tasks |
xargs -n $NUM_COLUMNS -- $0 runtime-task $raw_dir ||
die "Some tasks failed."
die "*** Some tasks failed. ***"
cp -v $provenance $raw_dir
}
View
@@ -1381,8 +1381,10 @@ def RunFunc(self, func_node, argv):
except _ControlFlow as e:
if e.IsReturn():
status = e.StatusCode()
elif e.IsExit():
raise
else:
# break/continue used in the wrong place
# break/continue used in the wrong place.
e_die('Unexpected %r (in function call)', e.token.val, token=e.token)
finally:
self.mem.PopCall()
View
@@ -89,7 +89,9 @@ echo status=$?
# OK dash stdout: status=127
### Exit builtin
exit 3
f() { exit 3; }
f
exit 4
# status: 3
### Exit builtin with invalid arg

0 comments on commit 24ef5fc

Please sign in to comment.