diff options
author | Nicholas Clark <nick@ccl4.org> | 2011-05-15 14:45:53 +0100 |
---|---|---|
committer | Nicholas Clark <nick@ccl4.org> | 2011-06-11 10:39:59 +0200 |
commit | 82ff486e3dffdd873d119ab2245448a996948e2d (patch) | |
tree | 9853646997e1cd61fb27786a8f09d11891474cd8 /mg_raw.h | |
parent | e0a73de458fc6a8b96ea80ab0485ce7bdabb4c8b (diff) | |
download | perl-82ff486e3dffdd873d119ab2245448a996948e2d.tar.gz |
In PL_magic_data flag whether magic can be added to a readonly value.
Use this to simplify the logic in Perl_sv_magic().
This introduces a small change of behaviour for error cases involving unknown
magic types. Previously, if Perl_sv_magic() was passed a magic type unknown to
it, it would
1: Croak "Modification of a read-only value attempted" if read only
2: Return without error if the SV happened to already have this magic
3: otherwise croak "Don't know how to handle magic of type \\%o"
Now it will always croak "Don't know how to handle magic of type \\%o", even
on read only values, or SVs which already have the unknown magic type.
Diffstat (limited to 'mg_raw.h')
-rw-r--r-- | mg_raw.h | 10 |
1 files changed, 5 insertions, 5 deletions
@@ -6,7 +6,7 @@ * Any changes made here will be lost! */ - { '\0', "want_vtbl_sv", + { '\0', "want_vtbl_sv | PERL_MAGIC_READONLY_ACCEPTABLE", "/* sv '\\0' Special scalar variable */" }, { 'A', "want_vtbl_amagic", "/* overload 'A' %OVERLOAD hash */" }, @@ -14,7 +14,7 @@ "/* overload_elem 'a' %OVERLOAD hash element */" }, { 'c', "want_vtbl_ovrld", "/* overload_table 'c' Holds overload table (AMT) on stash */" }, - { 'B', "want_vtbl_regexp | PERL_MAGIC_VALUE_MAGIC", + { 'B', "want_vtbl_regexp | PERL_MAGIC_READONLY_ACCEPTABLE | PERL_MAGIC_VALUE_MAGIC", "/* bm 'B' Boyer-Moore (fast string search) */" }, { 'D', "want_vtbl_regdata", "/* regdata 'D' Regex match position data (@+ and @- vars) */" }, @@ -24,9 +24,9 @@ "/* env 'E' %ENV hash */" }, { 'e', "want_vtbl_envelem", "/* envelem 'e' %ENV hash element */" }, - { 'f', "want_vtbl_regdata | PERL_MAGIC_VALUE_MAGIC", + { 'f', "want_vtbl_regdata | PERL_MAGIC_READONLY_ACCEPTABLE | PERL_MAGIC_VALUE_MAGIC", "/* fm 'f' Formline ('compiled' format) */" }, - { 'g', "want_vtbl_mglob | PERL_MAGIC_VALUE_MAGIC", + { 'g', "want_vtbl_mglob | PERL_MAGIC_READONLY_ACCEPTABLE | PERL_MAGIC_VALUE_MAGIC", "/* regex_global 'g' m//g target / study()ed string */" }, { 'H', "want_vtbl_hints", "/* hints 'H' %^H hash */" }, @@ -74,7 +74,7 @@ "/* arylen '#' Array length ($#ary) */" }, { '.', "want_vtbl_pos | PERL_MAGIC_VALUE_MAGIC", "/* pos '.' pos() lvalue */" }, - { '<', "want_vtbl_backref | PERL_MAGIC_VALUE_MAGIC", + { '<', "want_vtbl_backref | PERL_MAGIC_READONLY_ACCEPTABLE | PERL_MAGIC_VALUE_MAGIC", "/* backref '<' for weak ref data */" }, { ':', "magic_vtable_max | PERL_MAGIC_VALUE_MAGIC", "/* symtab ':' extra data for symbol tables */" }, |