develooper Front page | perl.perl5.porters | Postings from September 2016

[perl #128263] Assert fail in Perl_magic_get without other symptoms- '{tell$0;i${^LAST_FH}}'

Thread Previous
From:
Tony Cook via RT
Date:
September 6, 2016 04:34
Subject:
[perl #128263] Assert fail in Perl_magic_get without other symptoms- '{tell$0;i${^LAST_FH}}'
Message ID:
rt-4.0.24-7240-1473136469-1029.128263-15-0@perl.org
On Wed Aug 10 19:50:01 2016, sprout wrote:
> But rv2gv can sometimes return &PL_sv_undef.  To avoid a change in
> behaviour, I think a better fix would be to use
> 
> if (PL_last_in_gv && PL_last_in_gv != &PL_sv_undef) {
> 
> in mg.c (and to leave the assertion as-is, since having PL_last_in_gv
> set to anything else is a bug we want to be alerted about).

With that change (with a cast to make the pointers the same type),
should this from pp_readline be simplified?:

	    PL_last_in_gv = MUTABLE_GV(*PL_stack_sp--);
	    if (PL_last_in_gv == (GV *)&PL_sv_undef)
		PL_last_in_gv = NULL;
	    else
		assert(isGV_with_GP(PL_last_in_gv));

Tony


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

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