http://qs321.pair.com?node_id=11135342


in reply to Re: Inline::C : passing parameters to functions, modifying by reference
in thread Inline::C : passing parameters to functions, modifying by reference

syphilis, I was expecting your call. Thanks.

You saw that correctly. And the culprit, as per advice from LeoNerd at https://kiwiirc.com/nextclient/#irc://irc.perl.org/#perl (23/07/2021 @ 10:50 server time) is in the filling part: av_push(av, (SV *)av2); should become av_push(av, newRV_noinc((SV *)av2)); . And sv_setsv() should be sv_setrv()

Which is non-existent but LeoNerd posted this:

/************************************************************/ /* Monkeypath by LeoNerd to set an arrayref into a scalarref As posted on https://kiwiirc.com/nextclient/#irc://irc.perl.org/#pe +rl at 10:50 23/07/2021 A BIG THANK YOU LeoNerd */ #define HAVE_PERL_VERSION(R, V, S) \ (PERL_REVISION > (R) || (PERL_REVISION == (R) && (PERL_VERSION > ( +V) || (PERL_VERSION == (V) && (PERL_SUBVERSION >= (S)))))) #define sv_setrv(s, r) S_sv_setrv(aTHX_ s, r) static void S_sv_setrv(pTHX_ SV *sv, SV *rv) { sv_setiv(sv, (IV)rv); #if !HAVE_PERL_VERSION(5, 24, 0) SvIOK_off(sv); #endif SvROK_on(sv); } /************************************************************/

I am posting the full working script as a comment to my question.

bw, bliako