From: Tony Cook Date: Fri, 24 May 2013 13:04:05 +0000 (+1000) Subject: [rt #69243] use names for i_tags_addn() instead of ST(n) and handle magic X-Git-Tag: v0.96_01~16^2~8 X-Git-Url: http://git.imager.perl.org/imager.git/commitdiff_plain/b9e2571f45fe236eacc2249b4695e54e8e9a517a [rt #69243] use names for i_tags_addn() instead of ST(n) and handle magic The code checked SvOK() without SvGETMAGIC() --- diff --git a/Imager.xs b/Imager.xs index 53e91852..3dc6d0b2 100644 --- a/Imager.xs +++ b/Imager.xs @@ -3630,16 +3630,18 @@ i_img_to_drgb(im) Imager::ImgRaw im undef_int -i_tags_addn(im, name, code, idata) +i_tags_addn(im, name_sv, code, idata) Imager::ImgRaw im + SV *name_sv int code int idata PREINIT: char *name; STRLEN len; CODE: - if (SvOK(ST(1))) - name = SvPV(ST(1), len); + SvGETMAGIC(name_sv); + if (SvOK(name_sv)) + name = SvPV_nomg(name_sv, len); else name = NULL; RETVAL = i_tags_addn(&im->tags, name, code, idata);