diff options
author | Father Chrysostomos <sprout@cpan.org> | 2016-08-04 14:29:48 -0700 |
---|---|---|
committer | Father Chrysostomos <sprout@cpan.org> | 2016-08-04 17:42:39 -0700 |
commit | 1321bbe3f8d8397a8e988bac47b8f93b689b805b (patch) | |
tree | 09e55dc9dec0646d338196291b360a41c73bca93 /embed.fnc | |
parent | 5b2ef88ec2b538ad872eb354160909d8bd529aa7 (diff) | |
download | perl-1321bbe3f8d8397a8e988bac47b8f93b689b805b.tar.gz |
Rationalise gv.c:gv_magicalize
This code is confusing, and confusion has resulted in bugs. So rework
the code a bit to make it more comprehensible.
gv_magicalize no longer has such an arcane return value. What it does
now is simply add appropriate magic to (or do appropriate vivification
in) the GV passed as its argument. It returns true if magic or vivi-
fication was applicable.
The caller (gv_fetchpvn_flags) uses that return value to determine
whether to install the GV in the symbol table, if the caller has
requested that a symbol only be added if it is a magical one
(GV_ADDMG).
This reworking does mean that the GV is now checked for content even
when it would make no difference, but I think the resulting clarity
(ahem, *relative* clarity) of the code is worth it.
Diffstat (limited to 'embed.fnc')
-rw-r--r-- | embed.fnc | 2 |
1 files changed, 1 insertions, 1 deletions
@@ -1933,7 +1933,7 @@ s |bool|find_default_stash|NN HV **stash|NN const char *name \ |STRLEN len|const U32 is_utf8|const I32 add \ |const svtype sv_type s |bool|gv_magicalize|NN GV *gv|NN HV *stash|NN const char *name \ - |STRLEN len|bool addmg \ + |STRLEN len \ |const svtype sv_type s |void|maybe_multimagic_gv|NN GV *gv|NN const char *name|const svtype sv_type s |bool|gv_is_in_main|NN const char *name|STRLEN len \ |