… | |
… | |
18 | |
18 | |
19 | /* pre-5.10 perls always succeed, with 5.10, we have to check first apparently */ |
19 | /* pre-5.10 perls always succeed, with 5.10, we have to check first apparently */ |
20 | #ifndef GvNAME_HEK |
20 | #ifndef GvNAME_HEK |
21 | # define GvNAME_HEK(sv) 1 |
21 | # define GvNAME_HEK(sv) 1 |
22 | #endif |
22 | #endif |
|
|
23 | |
|
|
24 | #ifndef PadARRAY |
|
|
25 | # define PadARRAY(pad) AvARRAY (pad) |
|
|
26 | # define PadlistARRAY(pl) ((PAD **)AvARRAY (pl)) |
|
|
27 | #endif |
|
|
28 | |
23 | |
29 | |
24 | #define res_pair(text) \ |
30 | #define res_pair(text) \ |
25 | do { \ |
31 | do { \ |
26 | AV *av = newAV (); \ |
32 | AV *av = newAV (); \ |
27 | av_push (av, newSVpv (text, 0)); \ |
33 | av_push (av, newSVpv (text, 0)); \ |
… | |
… | |
158 | if (CvANON (sv) && !depth && CvPADLIST (sv)) |
164 | if (CvANON (sv) && !depth && CvPADLIST (sv)) |
159 | depth = 1; |
165 | depth = 1; |
160 | |
166 | |
161 | if (depth) |
167 | if (depth) |
162 | { |
168 | { |
163 | AV *padlist = CvPADLIST (sv); |
169 | PADLIST *padlist = CvPADLIST (sv); |
164 | |
170 | |
165 | while (depth) |
171 | while (depth) |
166 | { |
172 | { |
167 | AV *pad = (AV *)AvARRAY (padlist)[depth]; |
173 | PAD *pad = PadlistARRAY (padlist)[depth]; |
168 | |
174 | |
169 | av_push (excl, newSVuv (PTR2UV (pad))); /* exclude pads themselves from being found */ |
175 | av_push (excl, newSVuv (PTR2UV (pad))); /* exclude pads themselves from being found */ |
170 | |
176 | |
171 | /* The 0th pad slot is @_ */ |
177 | /* The 0th pad slot is @_ */ |
172 | if (AvARRAY (pad)[0] == targ) |
178 | if (PadARRAY (pad)[0] == targ) |
173 | res_pair ("the argument array for"); |
179 | res_pair ("the argument array for"); |
174 | |
180 | |
175 | for (i = AvFILLp (pad) + 1; --i; ) |
181 | for (i = AvFILLp (pad) + 1; --i; ) |
176 | if (AvARRAY (pad)[i] == targ) |
182 | if (AvARRAY (pad)[i] == targ) |
177 | { |
183 | { |
178 | /* Values from constant functions are stored in the pad without any name */ |
184 | /* Values from constant functions are stored in the pad without any name */ |
179 | SV *name_sv = AvARRAY (AvARRAY (padlist)[0])[i]; |
185 | SV *name_sv = PadARRAY (PadlistARRAY (padlist)[0])[i]; |
180 | |
186 | |
181 | if (name_sv && SvPOK (name_sv)) |
187 | if (name_sv && SvPOK (name_sv)) |
182 | res_pair (form ("the lexical '%s' in", SvPVX (name_sv))); |
188 | res_pair (form ("the lexical '%s' in", SvPVX (name_sv))); |
183 | else |
189 | else |
184 | res_pair ("an unnamed lexical in"); |
190 | res_pair ("an unnamed lexical in"); |