summaryrefslogtreecommitdiff
path: root/pad.h
diff options
context:
space:
mode:
authorFather Chrysostomos <sprout@cpan.org>2012-08-22 18:11:33 -0700
committerFather Chrysostomos <sprout@cpan.org>2012-08-22 18:11:33 -0700
commit4451054581ed5cb7c84863b6788f41b7c689b99d (patch)
tree429dabe3aa61e0d89d03ee85d4739dab5171f4ab /pad.h
parent7581b055f139e45e9f153aec81f967886db8c2d3 (diff)
downloadperl-4451054581ed5cb7c84863b6788f41b7c689b99d.tar.gz
pad.h: Let PADNAME_PV return null
Diffstat (limited to 'pad.h')
-rw-r--r--pad.h5
1 files changed, 3 insertions, 2 deletions
diff --git a/pad.h b/pad.h
index 4a2164b1fe..a966e81598 100644
--- a/pad.h
+++ b/pad.h
@@ -207,7 +207,8 @@ The C array of pad entries.
The index of the last pad entry.
=for apidoc Amx|char *|PADNAME_PV|PADNAME pn
-The name stored in the pad name struct.
+The name stored in the pad name struct. This returns NULL for a target or
+GV slot.
=for apidoc Amx|STRLEN|PADNAME_LEN|PADNAME pn
The length of the name.
@@ -286,7 +287,7 @@ Restore the old pad saved into the local variable opad by PAD_SAVE_LOCAL()
#define PAD_ARRAY(pad) AvARRAY(pad)
#define PAD_MAX(pad) AvFILLp(pad)
-#define PADNAME_PV(pn) SvPV_nolen(pn)
+#define PADNAME_PV(pn) (SvPOKp(pn) ? SvPVX(pn) : NULL)
#define PADNAME_LEN(pn) SvCUR(pn)
#define PADNAME_UTF8(pn) !!SvUTF8(pn)
#define PADNAME_SV(pn) pn