You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Zefram and mst opined in #p5p that this might be fixable:
(Zefram) your four() function doesn't sv_force_normal() or otherwise respect SvREADONLY
(mst) I guess nobody realised they needed to teach Inline::C about that
(Zefram) Inline::C can't tell whether the function body is going to try to mutate the string. XS has the same problem
(Mithaldu) is there a quick and common way to declare those inputs as "gonna mutate those"?
(Zefram) no, it's a rare need
(Zefram) you'll have to take an SV* and do it yourself, or create a custom typemap to do it if you need it a lot
(Zefram) the failure to respect SvREADONLY is a reportable bug in any case
(Mithaldu) how does one normally respect SvREADONLY?
(Zefram) if(SvREADONLY(argsv)) croak("woah nelly!");
(Zefram) sv_force_normal() is a better way, because COWed strings are SvREADONLY but may actually be mutatable
(Zefram) sv_force_normal() will de-COW and remove the SvREADONLY status if you're allowed to mutate the scalar
The text was updated successfully, but these errors were encountered:
Found in Perl-GPU/OpenGL-Modern#16
This code does not work reliably: https://gist.github.com/wchristian/6df5740d442002a311cbeb8282cfca4d
Zefram and mst opined in #p5p that this might be fixable:
The text was updated successfully, but these errors were encountered: