New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
P/p pack formats only recognize literal undef #7790
Comments
From perl-5.8.0@ton.iguana.beCreated by perl-5.8.0@ton.iguana.beperl -le 'print unpack("H*", pack("P", undef))' After the proposed patch: perl -le 'print unpack("H*", pack("P", undef))' Patch relative to 5.8.6: Inline Patch--- pp_pack.c.old Sat Jan 29 13:26:27 2005
+++ pp_pack.c Sun Feb 6 22:47:56 2005
@@ -2573,8 +2573,8 @@
case 'p':
while (len-- > 0) {
fromstr = NEXTFROM;
- if (fromstr == &PL_sv_undef)
- aptr = NULL;
+ SvGETMAGIC(fromstr);
+ if (!SvOK(fromstr)) aptr = NULL;
else {
STRLEN n_a;
/* XXX better yet, could spirit away the string to
@@ -2590,9 +2590,9 @@
"Attempt to pack pointer to temporary value");
}
if (SvPOK(fromstr) || SvNIOK(fromstr))
- aptr = SvPV(fromstr,n_a);
+ aptr = SvPV_flags(fromstr,n_a, 0);
else
- aptr = SvPV_force(fromstr,n_a);
+ aptr = SvPV_force_flags(fromstr,n_a, 0);
}
sv_catpvn(cat, (char*)&aptr, sizeof(char*));
} Perl Info
|
From @rgsperl-5.8.0@ton.iguana.be (via RT) wrote:
Thanks, applied as #23951. |
The RT System itself - Status changed from 'new' to 'open' |
@rgs - Status changed from 'new' to 'resolved' |
Migrated from rt.perl.org#34076 (status was 'resolved')
Searchable as RT34076$
The text was updated successfully, but these errors were encountered: