Decrease refcnt when error happend while unpacking

Fixes #152
This commit is contained in:
INADA Naoki 2015-11-08 12:38:38 +09:00
parent a329850147
commit 35a69ac9c2
2 changed files with 7 additions and 2 deletions

View file

@ -70,6 +70,10 @@ static inline PyObject* unpack_data(unpack_context* ctx)
return (ctx)->stack[0].obj;
}
static inline PyObject* unpack_clear(unpack_context *ctx)
{
Py_CLEAR(ctx->stack[0].obj);
}
template <bool construct>
static inline int unpack_execute(unpack_context* ctx, const char* data, Py_ssize_t len, Py_ssize_t* off)