summaryrefslogtreecommitdiff
path: root/sv.c
diff options
context:
space:
mode:
authorNicholas Clark <nick@ccl4.org>2011-05-15 13:54:19 +0100
committerNicholas Clark <nick@ccl4.org>2011-06-11 10:39:59 +0200
commite0a73de458fc6a8b96ea80ab0485ce7bdabb4c8b (patch)
tree975adf1ca5ede1fafbda518f0c25887da53a7775 /sv.c
parent6f83ef0e5a45c465f83de3304c5818ba44492250 (diff)
downloadperl-e0a73de458fc6a8b96ea80ab0485ce7bdabb4c8b.tar.gz
Store a flag for container/value magic in PL_magic_data.
Use this to replace S_is_container_magic() in mg.c with a direct lookup.
Diffstat (limited to 'sv.c')
-rw-r--r--sv.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/sv.c b/sv.c
index 779da64910..67c07f8848 100644
--- a/sv.c
+++ b/sv.c
@@ -5281,7 +5281,8 @@ Perl_sv_magic(pTHX_ register SV *const sv, SV *const obj, const int how,
}
if (how < 0 || how > C_ARRAY_LENGTH(PL_magic_data)
- || (vtable_index = PL_magic_data[how]) > magic_vtable_max)
+ || ((vtable_index = PL_magic_data[how] & PERL_MAGIC_VTABLE_MASK)
+ > magic_vtable_max))
Perl_croak(aTHX_ "Don't know how to handle magic of type \\%o", how);
/* PERL_MAGIC_ext is reserved for use by extensions not perl internals.