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

Reply via email to