summaryrefslogtreecommitdiff
path: root/pp_ctl.c
diff options
context:
space:
mode:
authorFather Chrysostomos <sprout@cpan.org>2012-10-16 18:04:28 -0700
committerFather Chrysostomos <sprout@cpan.org>2012-10-16 21:51:46 -0700
commit8771da69db30134352181c38401c7e50753a7ee8 (patch)
tree10c5d26ce8e3d86763deb53b5d0a1e68d860ea90 /pp_ctl.c
parent61c8799482f9e533904bfe832138c24064709f7d (diff)
downloadperl-8771da69db30134352181c38401c7e50753a7ee8.tar.gz
Used pad name lists for pad ids
I added pad IDs so that a pad could record which pad it closes over, to avoid problems with closures closing over the wrong pad, resulting in crashes or bizarre copies. These pad IDs were shared between clones of the same pad. In commit 9ef8d56, for efficiency I made clones of the same closure share the same pad name list. It has just occurred to be that each padlist containing the same pad name list also has the same pad ID, so we can just use the pad name list itself as the ID. This makes padlists 32 bits smaller and eliminates PL_pad_generation from the interpreter struct.
Diffstat (limited to 'pp_ctl.c')
-rw-r--r--pp_ctl.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/pp_ctl.c b/pp_ctl.c
index 1aaa26156b..bc9b647cf6 100644
--- a/pp_ctl.c
+++ b/pp_ctl.c
@@ -3273,7 +3273,8 @@ Perl_find_runcv_where(pTHX_ U8 cond, IV arg, U32 *db_seqp)
switch (cond) {
case FIND_RUNCV_padid_eq:
if (!CvPADLIST(cv)
- || CvPADLIST(cv)->xpadl_id != (U32)arg) continue;
+ || PadlistNAMES(CvPADLIST(cv)) != (PADNAMELIST *)arg)
+ continue;
return cv;
case FIND_RUNCV_level_eq:
if (level++ != arg) continue;