summaryrefslogtreecommitdiff
path: root/pp_hot.c
diff options
context:
space:
mode:
authorChip Salzenberg <chip@atlantic.net>1997-01-28 23:11:15 +1200
committerChip Salzenberg <chip@atlantic.net>1997-01-29 18:11:00 +1200
commit1ca7b98ad174fbe71cdc4e5666d8b6784b21f767 (patch)
tree41a69c47951a7ad14ed58f149e9cc7129cd21e07 /pp_hot.c
parent8a019ce79d3f6edbd72a4f740238e43eaea4945e (diff)
downloadperl-1ca7b98ad174fbe71cdc4e5666d8b6784b21f767.tar.gz
Prevent premature death of @_ during leavesub
Diffstat (limited to 'pp_hot.c')
-rw-r--r--pp_hot.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/pp_hot.c b/pp_hot.c
index 707239fb1b..120c026b4b 100644
--- a/pp_hot.c
+++ b/pp_hot.c
@@ -1656,7 +1656,7 @@ PP(pp_leavesub)
register CONTEXT *cx;
POPBLOCK(cx,newpm);
- POPSUB(cx);
+ /* Delay POPSUB until stack values are safe */
if (gimme == G_SCALAR) {
MARK = newsp + 1;
@@ -1678,6 +1678,9 @@ PP(pp_leavesub)
/* in case LEAVE wipes old return values */
}
+ /* Now that stack values are safe, release CV and @_ */
+ POPSUB(cx);
+
curpm = newpm; /* Don't pop $1 et al till now */
LEAVE;