--- CBOR-XS/XS.xs 2015/09/20 23:25:53 1.48 +++ CBOR-XS/XS.xs 2016/02/25 02:29:22 1.50 @@ -451,7 +451,8 @@ { dSP; - ENTER; SAVETMPS; PUSHMARK (SP); + ENTER; SAVETMPS; + PUSHMARK (SP); // we re-bless the reference to get overload and other niceties right XPUSHs (sv_bless (sv_2mortal (newRV_inc (sv)), stash)); @@ -474,7 +475,9 @@ { dSP; - ENTER; SAVETMPS; PUSHMARK (SP); + ENTER; SAVETMPS; + SAVESTACK_POS (); + PUSHMARK (SP); EXTEND (SP, 2); // we re-bless the reference to get overload and other niceties right PUSHs (sv_bless (sv_2mortal (newRV_inc (sv)), stash)); @@ -751,9 +754,10 @@ I32 len = decode_uint (dec); char *key = (char *)dec->cur; + WANT (len); dec->cur += len; - hv_store (hv, key, len, decode_sv (dec), 0); + hv_store (hv, key, len, decode_sv (dec), 0); return; } @@ -762,6 +766,7 @@ I32 len = decode_uint (dec); char *key = (char *)dec->cur; + WANT (len); dec->cur += len; if (ecb_expect_false (dec->cbor.flags & F_VALIDATE_UTF8)) @@ -994,7 +999,8 @@ dSP; - ENTER; SAVETMPS; PUSHMARK (SP); + ENTER; SAVETMPS; + PUSHMARK (SP); EXTEND (SP, len + 1); // we re-bless the reference to get overload and other niceties right PUSHs (*av_fetch (av, 0, 1)); @@ -1029,7 +1035,9 @@ sv = decode_sv (dec); dSP; - ENTER; SAVETMPS; PUSHMARK (SP); + ENTER; SAVETMPS; + SAVESTACK_POS (); + PUSHMARK (SP); EXTEND (SP, 2); PUSHs (newSVuv (tag)); PUSHs (sv);