mirror of
https://github.com/msgpack/msgpack-c.git
synced 2025-03-19 21:18:23 +01:00
The object root can be NULL
This commit is contained in:
parent
f0e044ecd8
commit
5bdac96375
@ -50,8 +50,7 @@ static int template_execute(msgpack_unpack_t* u PERL_UNUSED_DECL,
|
|||||||
|
|
||||||
STATIC_INLINE SV* template_callback_root(unpack_user* u PERL_UNUSED_DECL)
|
STATIC_INLINE SV* template_callback_root(unpack_user* u PERL_UNUSED_DECL)
|
||||||
{
|
{
|
||||||
dTHX;
|
return NULL;
|
||||||
return &PL_sv_undef;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
STATIC_INLINE int template_callback_uint8(unpack_user* u PERL_UNUSED_DECL, uint8_t d, SV** o)
|
STATIC_INLINE int template_callback_uint8(unpack_user* u PERL_UNUSED_DECL, uint8_t d, SV** o)
|
||||||
@ -310,7 +309,7 @@ STATIC_INLINE SV* _execute_impl(SV* self, SV* data, UV off, size_t limit) {
|
|||||||
XS(xs_unpacker_execute) {
|
XS(xs_unpacker_execute) {
|
||||||
dXSARGS;
|
dXSARGS;
|
||||||
if (items != 3) {
|
if (items != 3) {
|
||||||
Perl_croak(aTHX_ "Usage: $unpacker->execute_limit(data, off)");
|
Perl_croak(aTHX_ "Usage: $unpacker->execute(data, off)");
|
||||||
}
|
}
|
||||||
|
|
||||||
UNPACKER(ST(0), mp);
|
UNPACKER(ST(0), mp);
|
||||||
@ -398,8 +397,8 @@ XS(xs_unpacker_destroy) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
UNPACKER(ST(0), mp);
|
UNPACKER(ST(0), mp);
|
||||||
SV * data = template_data(mp);
|
SV* const data = template_data(mp);
|
||||||
if (SvOK(data)) {
|
if (data) {
|
||||||
SvREFCNT_dec(data);
|
SvREFCNT_dec(data);
|
||||||
}
|
}
|
||||||
Safefree(mp);
|
Safefree(mp);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user