develooper Front page | perl.perl5.porters | Postings from January 2008

[PATCH] mg_magical() sometimes turns SvRMAGICAL on when it shouldn't

Thread Next
From:
Vincent Pit
Date:
January 2, 2008 05:10
Subject:
[PATCH] mg_magical() sometimes turns SvRMAGICAL on when it shouldn't
Message ID:
477B8D35.1090009@profvince.com
Consider two kinds of magic :
- magic A, which has get/set callbacks (e.g. for which Sv{G,S}MAGICAL
are on) ;
- magic B, which hasn't.
If those magic are attached on a sv in such a way that the MAGIC chain
looks like sv -> A -> B -> NULL (i.e. we first apply A and then B), then
mg_magical won't turn SvRMAGICAL on. However, if the chain is in the
opposite order (sv -> B -> A -> NULL), SvRMAGICAL will be turned on.
This patch corrects this behaviour by turning SvRMAGICAL on only when :
- either all the magics don't have get or set callbacks ;
- or any of the magics has a clear callback.
Tested ok with blead@32802 on x86_64.

Vincent Pit.

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