/* --- 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 -------------------------------------------- */
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;