]> git.vpit.fr Git - perl/modules/Variable-Magic.git/blobdiff - Magic.xs
call_sv() ought to take an I32
[perl/modules/Variable-Magic.git] / Magic.xs
index f26774dddf4a830ecddf812e3b295693e7546e4d..3a170c0332a32e77402fffcf5aa91c9816f9c4bd 100644 (file)
--- a/Magic.xs
+++ b/Magic.xs
@@ -1029,7 +1029,7 @@ STATIC int vmg_svt_free(pTHX_ SV *sv, MAGIC *mg) {
  PERL_CONTEXT saved_cx;
  I32 cxix;
 #endif
unsigned int had_err, has_err, flags = G_SCALAR | G_EVAL;
I32 had_err, has_err, flags = G_SCALAR | G_EVAL;
  int ret = 0;
 
  dSP;
@@ -1340,6 +1340,7 @@ SV *_wizard(...)
 PROTOTYPE: DISABLE
 PREINIT:
  I32 i = 0;
+ UV opinfo;
  MGWIZ *w;
  MGVTBL *t;
  SV *cb;
@@ -1365,10 +1366,13 @@ CODE:
  Newx(w, 1, MGWIZ);
 
  VMG_SET_CB(ST(i++), data);
+
  cb = ST(i++);
- w->opinfo = SvOK(cb) ? SvUV(cb) : 0;
+ opinfo = SvOK(cb) ? SvUV(cb) : 0;
+ w->opinfo = (U8) ((opinfo < 255) ? opinfo : 255);
  if (w->opinfo)
   vmg_op_info_init(w->opinfo);
+
  VMG_SET_SVT_CB(ST(i++), get);
  VMG_SET_SVT_CB(ST(i++), set);
  VMG_SET_SVT_CB(ST(i++), len);