mirror of
https://github.com/msgpack/msgpack-c.git
synced 2025-10-25 10:09:38 +02:00
Taking NULL is a bug
This commit is contained in:
@@ -143,14 +143,13 @@ STATIC_INLINE int try_int(enc_t* enc, const char *p, size_t len) {
|
|||||||
|
|
||||||
static void _msgpack_pack_rv(enc_t *enc, SV* sv, int depth);
|
static void _msgpack_pack_rv(enc_t *enc, SV* sv, int depth);
|
||||||
|
|
||||||
STATIC_INLINE void _msgpack_pack_sv(enc_t *enc, SV* sv, int depth) {
|
STATIC_INLINE void _msgpack_pack_sv(enc_t* const enc, SV* const sv, int const depth) {
|
||||||
dTHX;
|
dTHX;
|
||||||
|
assert(sv);
|
||||||
if (depth <= 0) Perl_croak(aTHX_ ERR_NESTING_EXCEEDED);
|
if (depth <= 0) Perl_croak(aTHX_ ERR_NESTING_EXCEEDED);
|
||||||
SvGETMAGIC(sv);
|
SvGETMAGIC(sv);
|
||||||
|
|
||||||
if (sv==NULL) {
|
if (SvPOKp(sv)) {
|
||||||
msgpack_pack_nil(enc);
|
|
||||||
} else if (SvPOKp(sv)) {
|
|
||||||
STRLEN len;
|
STRLEN len;
|
||||||
char * csv = SvPV(sv, len);
|
char * csv = SvPV(sv, len);
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user