develooper Front page | perl.perl5.porters | Postings from January 2012

[perl #108480] Binop assignment on Copy-On-Write shared hash key fails

Thread Previous
From:
Father Chrysostomos via RT
Date:
January 17, 2012 23:08
Subject:
[perl #108480] Binop assignment on Copy-On-Write shared hash key fails
Message ID:
rt-3.6.HEAD-14510-1326870507-1529.108480-15-0@perl.org
On Tue Jan 17 14:04:57 2012, heinz.knutzen@gmx.de wrote:
> If a binop assignment is applied to
> - a numeric string from a hash key on the left side
> - and an integer on the right side,
> we expect a numeric result
> but get undef instead.
> 
> Example:
> perl -MDevel::Peek -E '%h=(150=>1);$i=(keys %h)[0];Dump
> $i;$i|=105;Dump $i;'
> SV = PV(0x86970a0) at 0x86aa248
>    REFCNT = 1
>    FLAGS = (POK,FAKE,READONLY,pPOK)
>    PV = 0x86b4294 "150"
>    CUR = 3
>    LEN = 0
> SV = PVIV(0x86a0680) at 0x86aa248
>    REFCNT = 1
>    FLAGS = ()
>    IV = 255
>    PV = 0x86a8e68 "150"\0
>    CUR = 3
>    LEN = 16
> 
> The result is expected to be 255.
> This is calculated correctly, but not shown, because all FLAGS are
> cleared.
> 
> I think this problem has been introduced in commit b20c4ee at 4 Oct
> 2010.

It’s a fair binop, guv!

Sorry about that.  I have just fixed it in commit 5ee80e1.

-- 

Father Chrysostomos


---
via perlbug:  queue: perl5 status: new
https://rt.perl.org:443/rt3/Ticket/Display.html?id=108480

Thread Previous


nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About