summaryrefslogtreecommitdiff
path: root/cop.h
diff options
context:
space:
mode:
authorFather Chrysostomos <sprout@cpan.org>2012-08-27 23:03:36 -0700
committerFather Chrysostomos <sprout@cpan.org>2012-08-27 23:24:03 -0700
commitd37427bce6f3a7163805f4a86194bcfabaf0e2c0 (patch)
tree17b4b2361c93e72f9aee4e5caa927fb4b668b4b1 /cop.h
parent19bcb54e626c56999bd22347f278ae81abf0eb1c (diff)
downloadperl-d37427bce6f3a7163805f4a86194bcfabaf0e2c0.tar.gz
Stop here-docs from gutting (caller $n)[6]
(caller $n)[6] returns the text of the eval. Actually, it would return, not the text of the eval, but the text with all the here-doc bodies missing. In this commit, I’m abusing the SvSCREAM flag to indicate that the eval text stored in the context stack is refcounted.
Diffstat (limited to 'cop.h')
-rw-r--r--cop.h2
1 files changed, 2 insertions, 0 deletions
diff --git a/cop.h b/cop.h
index 7f0dbbdda0..e05c89ec5e 100644
--- a/cop.h
+++ b/cop.h
@@ -717,6 +717,8 @@ struct block_eval {
PL_in_eval = CxOLD_IN_EVAL(cx); \
optype = CxOLD_OP_TYPE(cx); \
PL_eval_root = cx->blk_eval.old_eval_root; \
+ if (cx->blk_eval.cur_text && SvSCREAM(cx->blk_eval.cur_text)) \
+ SvREFCNT_dec(cx->blk_eval.cur_text); \
if (cx->blk_eval.old_namesv) \
sv_2mortal(cx->blk_eval.old_namesv); \
} STMT_END