Skip to content

Commit

Permalink
Storable: blessed long vstrings
Browse files Browse the repository at this point in the history
I made a mistake in the long vstring code.  The stored blessing was
being ignored.
  • Loading branch information
Father Chrysostomos committed Jul 31, 2012
1 parent 4ad9e49 commit 7e2a0d4
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
2 changes: 1 addition & 1 deletion dist/Storable/Storable.xs
Expand Up @@ -4943,7 +4943,7 @@ static SV *retrieve_lvstring(pTHX_ stcxt_t *cxt, const char *cname)
New(10003, s, len+1, char);
SAFEPVREAD(s, len, s);

sv = retrieve(aTHX_ cxt, 0);
sv = retrieve(aTHX_ cxt, cname);

sv_magic(sv,NULL,PERL_MAGIC_vstring,s,len);
/* 5.10.0 and earlier seem to need this */
Expand Down
3 changes: 2 additions & 1 deletion dist/Storable/t/blessed.t
Expand Up @@ -30,6 +30,7 @@ use Storable qw(freeze thaw store retrieve);
%::weird_refs = (
REF => \(my $aref = []),
VSTRING => \(my $vstring = v1.2.3),
'long VSTRING' => \(my $vstring = eval "v" . 0 x 300),
LVALUE => \(my $substr = substr((my $str = "foo"), 0, 3)),
);
}
Expand Down Expand Up @@ -285,7 +286,7 @@ is(ref $t, 'STRESS_THE_STACK');
my $thawn = thaw($frozen);
# is_deeply ignores blessings
is ref $thawn, ref $obj, "get the right blessing back for $weird";
if ($weird eq 'VSTRING') {
if ($weird =~ 'VSTRING') {
# It is not just Storable that did not support vstrings. :-)
# See https://rt.cpan.org/Ticket/Display.html?id=78678
my $newver = "version"->can("new")
Expand Down

0 comments on commit 7e2a0d4

Please sign in to comment.