… | |
… | |
449 | |
449 | |
450 | if ((method = gv_fetchmethod_autoload (stash, "TO_CBOR", 0))) |
450 | if ((method = gv_fetchmethod_autoload (stash, "TO_CBOR", 0))) |
451 | { |
451 | { |
452 | dSP; |
452 | dSP; |
453 | |
453 | |
454 | ENTER; SAVETMPS; PUSHMARK (SP); |
454 | ENTER; SAVETMPS; |
|
|
455 | PUSHMARK (SP); |
455 | // we re-bless the reference to get overload and other niceties right |
456 | // we re-bless the reference to get overload and other niceties right |
456 | XPUSHs (sv_bless (sv_2mortal (newRV_inc (sv)), stash)); |
457 | XPUSHs (sv_bless (sv_2mortal (newRV_inc (sv)), stash)); |
457 | |
458 | |
458 | PUTBACK; |
459 | PUTBACK; |
459 | // G_SCALAR ensures that return value is 1 |
460 | // G_SCALAR ensures that return value is 1 |
… | |
… | |
472 | } |
473 | } |
473 | else if ((method = gv_fetchmethod_autoload (stash, "FREEZE", 0)) != 0) |
474 | else if ((method = gv_fetchmethod_autoload (stash, "FREEZE", 0)) != 0) |
474 | { |
475 | { |
475 | dSP; |
476 | dSP; |
476 | |
477 | |
477 | ENTER; SAVETMPS; PUSHMARK (SP); |
478 | ENTER; SAVETMPS; |
|
|
479 | SAVESTACK_POS (); |
|
|
480 | PUSHMARK (SP); |
478 | EXTEND (SP, 2); |
481 | EXTEND (SP, 2); |
479 | // we re-bless the reference to get overload and other niceties right |
482 | // we re-bless the reference to get overload and other niceties right |
480 | PUSHs (sv_bless (sv_2mortal (newRV_inc (sv)), stash)); |
483 | PUSHs (sv_bless (sv_2mortal (newRV_inc (sv)), stash)); |
481 | PUSHs (sv_cbor); |
484 | PUSHs (sv_cbor); |
482 | |
485 | |
… | |
… | |
994 | if (!method) |
997 | if (!method) |
995 | ERR ("cannot decode perl-object (package does not have a THAW method)"); |
998 | ERR ("cannot decode perl-object (package does not have a THAW method)"); |
996 | |
999 | |
997 | dSP; |
1000 | dSP; |
998 | |
1001 | |
999 | ENTER; SAVETMPS; PUSHMARK (SP); |
1002 | ENTER; SAVETMPS; |
|
|
1003 | PUSHMARK (SP); |
1000 | EXTEND (SP, len + 1); |
1004 | EXTEND (SP, len + 1); |
1001 | // we re-bless the reference to get overload and other niceties right |
1005 | // we re-bless the reference to get overload and other niceties right |
1002 | PUSHs (*av_fetch (av, 0, 1)); |
1006 | PUSHs (*av_fetch (av, 0, 1)); |
1003 | PUSHs (sv_cbor); |
1007 | PUSHs (sv_cbor); |
1004 | |
1008 | |
… | |
… | |
1029 | default: |
1033 | default: |
1030 | { |
1034 | { |
1031 | sv = decode_sv (dec); |
1035 | sv = decode_sv (dec); |
1032 | |
1036 | |
1033 | dSP; |
1037 | dSP; |
1034 | ENTER; SAVETMPS; PUSHMARK (SP); |
1038 | ENTER; SAVETMPS; |
|
|
1039 | SAVESTACK_POS (); |
|
|
1040 | PUSHMARK (SP); |
1035 | EXTEND (SP, 2); |
1041 | EXTEND (SP, 2); |
1036 | PUSHs (newSVuv (tag)); |
1042 | PUSHs (newSVuv (tag)); |
1037 | PUSHs (sv); |
1043 | PUSHs (sv); |
1038 | |
1044 | |
1039 | PUTBACK; |
1045 | PUTBACK; |