restore_magic(aTHXo_ (void*)mgs_ix);
restore_magic(aTHXo_ (void*)(intptr_t)mgs_ix);
Perl_mg_get(pTHX_ SV *sv){    I32 mgs_ix;    MAGIC* mg;    MAGIC** mgp;    int mgp_valid = 0;    mgs_ix = SSNEW(sizeof(MGS));    save_magic(mgs_ix, sv);    mgp = &SvMAGIC(sv);    while ((mg = *mgp) != 0) {	MGVTBL* vtbl = mg->mg_virtual;	if (!(mg->mg_flags & MGf_GSKIP) && vtbl && vtbl->svt_get) {	    CALL_FPTR(vtbl->svt_get)(aTHX_ sv, mg);	    /* Ignore this magic if it's been deleted */	    if ((mg == (mgp_valid ? *mgp : SvMAGIC(sv))) &&		  (mg->mg_flags & MGf_GSKIP))		(SSPTR(mgs_ix, MGS*))->mgs_flags = 0;	}	/* Advance to next magic (complicated by possible deletion) */	if (mg == (mgp_valid ? *mgp : SvMAGIC(sv))) {	    mgp = &mg->mg_moremagic;	    mgp_valid = 1;	}	else	    mgp = &SvMAGIC(sv);	/* Re-establish pointer after sv_upgrade */    }    restore_magic(aTHXo_ (void*)mgs_ix);    return 0;}