data = (w->cb_data) ? vmg_data_new(w->cb_data, sv, args) : NULL;
mg = sv_magicext(sv, data, PERL_MAGIC_ext, w->vtbl, (const char *) wiz, HEf_SVKEY);
mg->mg_private = w->sig;
- mg->mg_flags = mg->mg_flags
#if MGf_COPY
- | MGf_COPY
+ if (w->cb_copy)
+ mg->mg_flags |= MGf_COPY;
#endif /* MGf_COPY */
#if MGf_DUP
- | MGf_DUP
+ if (w->cb_dup)
+ mg->mg_flags |= MGf_DUP;
#endif /* MGf_DUP */
#if MGf_LOCAL
- | MGf_LOCAL
+ if (w->cb_local)
+ mg->mg_flags |= MGf_LOCAL;
#endif /* MGf_LOCAL */
- ;
#if VMG_UVAR
if (w->uvar && SvTYPE(sv) >= SVt_PVHV) {