summaryrefslogtreecommitdiff
path: root/ext/B/B.xs
diff options
context:
space:
mode:
authorNicholas Clark <nick@ccl4.org>2005-06-14 16:29:49 +0000
committerNicholas Clark <nick@ccl4.org>2005-06-14 16:29:49 +0000
commitb55685ae0907b7da1c668988d736c684531f41ac (patch)
tree980bab4cef44cb982a73025979a4e4a8ad141a76 /ext/B/B.xs
parenta0d3aac481b5c4ba30633fed9f9f2dca6771f7bc (diff)
downloadperl-b55685ae0907b7da1c668988d736c684531f41ac.tar.gz
Change 24838 breaks deparse.t, which checks that embedded NULs work.
Here's a temporary hack, pending a way for B to correctly identify PVs that are variable names in pads. p4raw-id: //depot/perl@24843
Diffstat (limited to 'ext/B/B.xs')
-rw-r--r--ext/B/B.xs10
1 files changed, 9 insertions, 1 deletions
diff --git a/ext/B/B.xs b/ext/B/B.xs
index d317fb98bc..f9c8647b96 100644
--- a/ext/B/B.xs
+++ b/ext/B/B.xs
@@ -1215,7 +1215,15 @@ SvPV(sv)
CODE:
ST(0) = sv_newmortal();
if( SvPOK(sv) ) {
- sv_setpv(ST(0), SvPV_nolen_const(sv));
+ /* FIXME - we need a better way for B to identify PVs that are
+ in the pads as variable names. */
+ if((SvLEN(sv) && SvCUR(sv) >= SvLEN(sv))) {
+ /* It claims to be longer than the space allocated for it -
+ presuambly it's a variable name in the pad */
+ sv_setpv(ST(0), SvPV_nolen_const(sv));
+ } else {
+ sv_setpvn(ST(0), SvPVX_const(sv), SvCUR(sv));
+ }
SvFLAGS(ST(0)) |= SvUTF8(sv);
}
else {