Nick Ing-Simmons wrote:
> ....
> if (mystp = getmystructbyid(id)) {
> pushret_mystruct(mystp);
> return;
> } else {
> XSRETURN_EMPTY;
> }
This isn't quite right (well, actually it doesn't work :-) On examining
the code generated by xsubpp, it does a SP -= items; at the very
beginning of the generated code. This of course only updates the local
copy of SP, so when the called routine does a dSP it gets the value of
the SP before the subtraction. To fix it you simply need to PUTBACK;
before the call to pushret_mystruct.
See, because of your help I now really *do* understand what is going on
:-)
Thanks,
Alan Burlison
- Manipulating the perl stack from within a non-XSUB functi... Alan Burlison
- Re: Manipulating the perl stack from within a non-XS... Alan Burlison
- Re: Manipulating the perl stack from within a no... Stephen Zander
- Re: Manipulating the perl stack from within ... Alan Burlison
- Re: Manipulating the perl stack from within a non-XS... Nick Ing-Simmons
- Re: Manipulating the perl stack from within a no... Alan Burlison
- Re: Manipulating the perl stack from within a no... Alan Burlison
- Re: Manipulating the perl stack from within ... Nick Ing-Simmons
- Re: Manipulating the perl stack from wit... Alan Burlison
- Re: Manipulating the perl stack fro... Nick Ing-Simmons
