This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
don't mistake tr/// for assignable reference
authorZefram <zefram@fysh.org>
Wed, 6 Dec 2017 00:50:05 +0000 (00:50 +0000)
committerZefram <zefram@fysh.org>
Wed, 6 Dec 2017 00:50:05 +0000 (00:50 +0000)
commit38a3df78b8fbbdf02988dd5fe691c23a8041334f
tree5044e75299a6b4f22641a0acff5d8bd6157bbb08
parent557714184de18964b954b2c00fa13127fd3f216a
don't mistake tr/// for assignable reference

For the lhs of an assignment to be an assignable srefgen, the
srefgen must be its top-level op.  ck_refassign() asserted that, but
S_assignment_type() was delving inside a null op looking for the srefgen,
the same way it looks for things that distinguish between scalar and
list assignment.  This showed up in a weird situation where a no-op
transliteration could be applied to an srefgen, getting an srefgen inside
a null op.  Fixes [perl #130578].
op.c
t/op/lvref.t