char *pkg = NULL;
char *name = NULL;
PPCODE:
+ SvGETMAGIC(coderef);
if (mop_get_code_info(coderef, &pkg, &name)) {
EXTEND(SP, 2);
mPUSHs(newSVpv(pkg, 0));
HV *stash;
bool found_method = FALSE;
PPCODE:
- if (!SvPOK(klass) || !SvCUR(klass)) {
+ SvGETMAGIC(klass);
+ if (!(SvPOKp(klass) && SvCUR(klass))) { /* XXX: SvPOK does not work with magical scalars */
XSRETURN_NO;
}