X-Git-Url: http://git.vpit.fr/?a=blobdiff_plain;f=Magic.xs;h=f7917abcad8c9fbde616cc2dd3bcb32f75ffeecd;hb=fd95773479714bce7f8578528e0172c37a4cf2d8;hp=9eda482e03a65e3652c7732e63b921a0386b47da;hpb=de1bca58e695e4df40b7c597d8181cc6ca5d9bb9;p=perl%2Fmodules%2FVariable-Magic.git diff --git a/Magic.xs b/Magic.xs index 9eda482..f7917ab 100644 --- a/Magic.xs +++ b/Magic.xs @@ -488,9 +488,8 @@ static opclass vmg_opclass(const OP *o) { /* --- Error messages ------------------------------------------------------ */ -static const char vmg_invalid_wiz[] = "Invalid wizard object"; -static const char vmg_wrongargnum[] = "Wrong number of arguments"; -static const char vmg_argstorefailed[] = "Error while storing arguments"; +static const char vmg_invalid_wiz[] = "Invalid wizard object"; +static const char vmg_wrongargnum[] = "Wrong number of arguments"; /* --- Context-safe global data -------------------------------------------- */ @@ -1246,11 +1245,18 @@ static int vmg_cb_call(pTHX_ SV *cb, unsigned int flags, SV *sv, ...) { svr = POPs; if (SvOK(svr)) ret = (int) SvIV(svr); + if (SvROK(svr)) + SvREFCNT_inc(svr); + else + svr = NULL; PUTBACK; FREETMPS; LEAVE; + if (svr && !SvTEMP(svr)) + sv_2mortal(svr); + if (chain) { vmg_dispell_guard_new(*chain); *chain = NULL;