develooper Front page | perl.perl5.porters | Postings from December 2009

[perl #71686] [PATCH] Globs that are in symbol table can be un-globbed

Thread Previous | Thread Next
From:
Lubomir Rintel via RT
Date:
December 29, 2009 05:18
Subject:
[perl #71686] [PATCH] Globs that are in symbol table can be un-globbed
Message ID:
rt-3.6.HEAD-1505-1262076781-1551.71686-15-0@perl.org
On Mon Dec 28 12:20:49 2009, lkundrak wrote:
> If a symbol table entry is undefined when a glob is assigned into it,
> it
> gets a FAKE flag which makes it possible to be downgraded when non-
> glob
> is subsequently assigned into it. It doesn't really matter, until we
> decide to localize it -- it wouldn't be possible to restore its GP
> upon
> context return if it changed type, therefore we must not do that.
> 
> This patch turns off FAKE flag when localizing a GV and restores it
> when
> the context is left. A test case is included.

On the other hand, a more correct solution would be to preserve the FAKE
flag and put GV (at least flags, name and stash) on savestack. That
would allow coercing of localized fake hashes and upgrade them back on
context leaves, but would not be as simple as this.

Should I attempt to prepare a patch that does that instead?

Thread Previous | Thread Next


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