summaryrefslogtreecommitdiff
path: root/pp_ctl.c
diff options
context:
space:
mode:
authorFather Chrysostomos <sprout@cpan.org>2012-11-02 12:35:25 -0700
committerFather Chrysostomos <sprout@cpan.org>2012-11-02 12:35:25 -0700
commita577af66bcfd9e2196e6de9a29cda9fd20b50841 (patch)
tree7447db5d4d0898579de40d4ab123cc2dea002ef8 /pp_ctl.c
parentc7bd8b847014f9a4cd5fa4bcf968ab4a8e11d2fe (diff)
downloadperl-a577af66bcfd9e2196e6de9a29cda9fd20b50841.tar.gz
Stop string eval from leaking ops
This was leaking: $ ./miniperl -Xe 'warn $$; while(1){eval "ok 8"};' 1915 at -e line 1. ^C This was not: $ ./miniperl -Xe 'warn $$; while(1){eval "sub {ok 8}"};' 1916 at -e line 1. ^C The sub is successfully taking care of its ops when it is freed. The eval is not. I made the mistake of having the CV relinquish ownership of the op slab after an eval syntax error. That’s precisely the situation in which the ops are likely to leak, and for which the slab allocator was designed. Duh.
Diffstat (limited to 'pp_ctl.c')
-rw-r--r--pp_ctl.c1
1 files changed, 0 insertions, 1 deletions
diff --git a/pp_ctl.c b/pp_ctl.c
index 869907d41b..27113c0206 100644
--- a/pp_ctl.c
+++ b/pp_ctl.c
@@ -3462,7 +3462,6 @@ S_doeval(pTHX_ int gimme, CV* outside, U32 seq, HV *hh)
PL_op = saveop;
if (yystatus != 3) {
if (PL_eval_root) {
- cv_forget_slab(evalcv);
op_free(PL_eval_root);
PL_eval_root = NULL;
}