On Wed Jul 17 10:14:29 2013, rurban@x-ray.at wrote:
Show quoted text> 5.19.2:
>
> t/01_pack.t ................. 1/43
> # Failed test 'dump a1 33'
> # at t/01_pack.t line 13.
> # got: 'cb 40 08 00 00 00 00 00 00'
> # expected: 'a1 33'
> # Looks like you failed 1 test of 43.
>
> test:
> do { my $x=3.0;my $y = "$x";$x }, 'a1 33', # PVNV
>
> PV instead of the NV.
Wrong. NV instead of the PV.
Show quoted text> I'll try to fix it on github
With perl-5.19 the PVNV has these properties:
(gdb) call Perl_sv_dump(val)
SV = PVNV(0x8bf920) at 0x7e2768
REFCNT = 1
FLAGS = (NOK,pNOK)
IV = 0
NV = 3
PV = 0
so pack sees only the NV, not the PV. So we need to fix the test to actually create a proper PVNV.
$ perl5.19.2 -MDevel::Peek -e'$s=do { my $x=3.0;my $y = "$x";$x }; print Dump($s)'
SV = PVNV(0x8f45d0) at 0x911b58
REFCNT = 1
FLAGS = (NOK,pNOK)
IV = 0
NV = 3
PV = 0
$ perl5.18.0 -MDevel::Peek -e'$s=do { my $x=3.0;my $y = "$x";$x }; print Dump($s)'
SV = PVNV(0x18415d0) at 0x185ea68
REFCNT = 1
FLAGS = (NOK,POK,pNOK,pPOK)
IV = 0
NV = 3
PV = 0x186a720 "3"\0
CUR = 1
LEN = 16