develooper Front page | perl.perl5.porters | Postings from February 2015

[perl #123821] OP_RV2CV can have OPpLVREF_CV

Hugo van der Sanden
February 14, 2015 00:22
[perl #123821] OP_RV2CV can have OPpLVREF_CV
Message ID:
# New Ticket Created by  Hugo van der Sanden 
# Please include the string:  [perl #123821]
# in the subject line of all future correspondence about this issue. 
# <URL: >

AFL (<>) finds:

% ./miniperl -e '\(&$0)=0'
Can't modify reference to subroutine dereference in list assignment at -e line 1, at EOF
Execution of -e aborted due to compilation errors.
miniperl: op.c:721: Perl_op_free: Assertion `!(o->op_private & ~PL_op_private_valid[type])' failed.
Aborted (core dumped)

The offending op is OP_RV2CV with op_private = 0x30. This is set (unusually a direct set, not an or - that might be an additional bug) in S_lvref:
        o->op_private = OPpLVREF_CV;

The same flag is mentioned for OP_RV2CV in Perl_ck_refassign (this time it is ored in), but regen/op_private mentions it only for op types 'refassign', 'lvref'.

I'm not sure what all this stuff means; if it should legitimately get set on RV2CV, some rearrangement may be needed - it looks like OPpMAY_RETURN_CONSTANT can safely be moved to a different bit value.

Hugo Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at | Group listing | About