summaryrefslogtreecommitdiff
path: root/pad.h
diff options
context:
space:
mode:
authorFather Chrysostomos <sprout@cpan.org>2014-12-06 17:21:13 -0800
committerFather Chrysostomos <sprout@cpan.org>2014-12-06 18:55:47 -0800
commitb4db5868141d6a659beb640efc92eabae9cd71c0 (patch)
tree32a4629352cfaa667561733cfcde37fb00099c1b /pad.h
parent6825610e8c8577939e98cbfff5232e71e5249daa (diff)
downloadperl-b4db5868141d6a659beb640efc92eabae9cd71c0.tar.gz
Revert ‘Used pad name lists for pad ids’
This reverts commit 8771da69db30134352181c38401c7e50753a7ee8. Pad lists need to carry IDs around with them, so that when something tries to close over a pad, it is possible to confirm that the right pad is being closed over (either the original outer pad, or a clone of it). (See the commit message of db4cf31d1, in which commit I added an ID to the padlist struct.) In 8771da69 I found that I could use the memory address of the pad’s name list (name lists are shared) and avoid the extra field. Some time after 8771da69 I realised that a pad list could be freed, and the same address reused for another pad list, so using a memory address may not be so wise. I thought it highly unlikely, though, and put it on the back burner. I have just run into that. t/comp/form_scope.t is now failing for me with test 13, added by db4cf31d1. It bisects to 3d6de2cd1 (PERL_PADNAME_MINIMAL), but that’s a red herring. Trivial changes to the script make the problem go away. And it only happens on non- debugging builds, and only on my machine. Stepping through with gdb shows that the format-cloning is following the format prototype’s out- side pointer and confirming that it is has the correct pad (yes, the memory addresses are the same), which I know it doesn’t, because I can see what the test is doing. While generation numbers can still fall afoul of the same problem, it is much less likely. Anyway, the worst thing about 8771da69 is the typo in the first word of the commit message.
Diffstat (limited to 'pad.h')
-rw-r--r--pad.h3
1 files changed, 2 insertions, 1 deletions
diff --git a/pad.h b/pad.h
index 207823af6a..555bc6513c 100644
--- a/pad.h
+++ b/pad.h
@@ -34,7 +34,8 @@ typedef U64TYPE PADOFFSET;
struct padlist {
SSize_t xpadl_max; /* max index for which array has space */
PAD ** xpadl_alloc; /* pointer to beginning of array of AVs */
- PADNAMELIST*xpadl_outid; /* Padnamelist of outer pad; used as ID */
+ U32 xpadl_id; /* Semi-unique ID, shared between clones */
+ U32 xpadl_outid; /* ID of outer pad */
};
struct padnamelist {