FAQ

On Thu May 26 18:57:12 2016, dcollinsn@gmail.com wrote:
dcollins@nightshade64:~/perldebug$ ./perl -Ilib -e 'sub
MODIFY_HASH_ATTRIBUTES{}my(%o):s==0'
perl: sv.c:2595: Perl_sv_2nv_flags: Assertion `((svtype)((sv)-
sv_flags & 0xff)) != SVt_PVAV && ((svtype)((sv)->sv_flags & 0xff)) !=
SVt_PVHV && ((svtype)((sv)->sv_flags & 0xff)) != SVt_PVFM' failed.
Aborted


This seems to be the "hash equivalent" of [perl #128183]?
No, #128183 has a backslash before the my() and an assignment operator after it. It has to do with refaliasing not playing nicely with attributes.

This bug is different:

$ ./perl -Ilib -MO=Concise -e 'my(%o):s==0'
g <@> leave[1 ref] vKP/REFC ->(end)
1 <0> enter ->2
2 <;> nextstate(main 64 -e:1) v:{ ->3
f <2> eq vK/2 ->g
d <@> list sK ->e
3 <0> pushmark v ->4
4 <0> padhv[%o:64,65] vPM/LVINTRO ->5
c <1> entersub[t2] vKS*/TARG ->d
5 <0> pushmark s ->6
6 <$> const[PV "attributes"] sM ->7
7 <$> const[PV "main"] sM ->8
9 <1> srefgen sKM/1 ->a
- <1> ex-list lKRM ->9
8 <0> padsv[%o:64,65] sRM ->9
a <$> const[PV "s"] sM ->b
b <.> method_named[PV "import"] ->c
e <$> const[IV 0] s ->f
-e syntax OK
$ ./perl -Ilib -MO=Concise -e 'my(%o)==0'
6 <@> leave[1 ref] vKP/REFC ->(end)
1 <0> enter ->2
2 <;> nextstate(main 1 -e:1) v:{ ->3
5 <2> eq vK/2 ->6
3 <0> padhv[%o:1,2] sPM/LVINTRO ->4
4 <$> const[IV 0] s ->5
-e syntax OK

When we have an attribute, the padhv op is in void context (the v in vPM/LVINTRO), whereas it should be in scalar context.

--

Father Chrysostomos


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

Search Discussions

Discussion Posts

Previous

Related Discussions

Discussion Navigation
viewthread | post
posts ‹ prev | 2 of 2 | next ›
Discussion Overview
groupperl5-porters @
categoriesperl
postedMay 27, '16 at 1:57a
activeMay 27, '16 at 2:49a
posts2
users1
websiteperl.org

1 user in discussion

Father Chrysostomos via RT: 2 posts

People

Translate

site design / logo © 2017 Grokbase