summaryrefslogtreecommitdiff
path: root/regcomp.h
diff options
context:
space:
mode:
authorDavid Mitchell <davem@iabyn.com>2015-06-19 09:51:10 +0100
committerDavid Mitchell <davem@iabyn.com>2015-06-19 09:51:10 +0100
commit9558026484c47d197ababb92c9e5477b379f7c42 (patch)
tree724ace37e61f3d9dbedb60c162de66466c933ac9 /regcomp.h
parent5ad25bdcb978e712488e7c2656949d6efd14e0b5 (diff)
parenta05700a87a1c6e3a191a8fcb99082092e4c5c6eb (diff)
downloadperl-9558026484c47d197ababb92c9e5477b379f7c42.tar.gz
[MERGE] refactor sub returns (pp_return etc)
This series of commits attempts to reduce duplication and partially unify the code that handles subroutine exit, in places like pp_leavesub, pp_return etc. In particular, pp_return has been heavily modified so that it is now only responsible for doing any extra work required above and beyond that done by pp_leavesub et al (popping contexts and removing junk left on the stack). It now tail calls pp_leavesub / pp_leaveeval/ etc to do the remaining heavy lifting. This reduces the code size of pp_return to about a quarter of what it was previously, and ensures that exactly the same processes happen regardless of whether an explicit return is is done or not. It also fixes using return in list context in a MULTICALL, e.g. use List::Util qw(pairmap); @a = pairmap { for (1,2) { return (3,4)} } qw(a b); formerly returned (1,2,3,4) and now returns (3,4). It also simplifies S_sortcv() et al which are responsible for calling a sort sub.
Diffstat (limited to 'regcomp.h')
0 files changed, 0 insertions, 0 deletions