mirror of
https://github.com/msgpack/msgpack-c.git
synced 2025-03-23 09:14:00 +01:00
Fix double INCREF-ing when unpacking.
This commit is contained in:
parent
1840ef70ae
commit
560bd901f8
@ -1,4 +1,4 @@
|
|||||||
/* Generated by Cython 0.11.2 on Mon Jun 8 01:28:30 2009 */
|
/* Generated by Cython 0.11.2 on Mon Jun 8 12:41:02 2009 */
|
||||||
|
|
||||||
#define PY_SSIZE_T_CLEAN
|
#define PY_SSIZE_T_CLEAN
|
||||||
#include "Python.h"
|
#include "Python.h"
|
||||||
@ -1724,7 +1724,7 @@ static PyObject *__pyx_pf_7msgpack_unpacks(PyObject *__pyx_self, PyObject *__pyx
|
|||||||
PyObject *__pyx_r = NULL;
|
PyObject *__pyx_r = NULL;
|
||||||
const char* __pyx_t_1;
|
const char* __pyx_t_1;
|
||||||
Py_ssize_t __pyx_t_2;
|
Py_ssize_t __pyx_t_2;
|
||||||
PyObject *__pyx_t_3;
|
PyObject *__pyx_t_3 = NULL;
|
||||||
__Pyx_SetupRefcountContext("unpacks");
|
__Pyx_SetupRefcountContext("unpacks");
|
||||||
__pyx_self = __pyx_self;
|
__pyx_self = __pyx_self;
|
||||||
|
|
||||||
@ -1752,7 +1752,7 @@ static PyObject *__pyx_pf_7msgpack_unpacks(PyObject *__pyx_self, PyObject *__pyx
|
|||||||
* cdef size_t off = 0
|
* cdef size_t off = 0
|
||||||
* template_init(&ctx) # <<<<<<<<<<<<<<
|
* template_init(&ctx) # <<<<<<<<<<<<<<
|
||||||
* template_execute(&ctx, p, len(packed_bytes), &off)
|
* template_execute(&ctx, p, len(packed_bytes), &off)
|
||||||
* return <object> template_data(&ctx)
|
* return template_data(&ctx)
|
||||||
*/
|
*/
|
||||||
template_init((&__pyx_v_ctx));
|
template_init((&__pyx_v_ctx));
|
||||||
|
|
||||||
@ -1760,7 +1760,7 @@ static PyObject *__pyx_pf_7msgpack_unpacks(PyObject *__pyx_self, PyObject *__pyx
|
|||||||
* cdef size_t off = 0
|
* cdef size_t off = 0
|
||||||
* template_init(&ctx)
|
* template_init(&ctx)
|
||||||
* template_execute(&ctx, p, len(packed_bytes), &off) # <<<<<<<<<<<<<<
|
* template_execute(&ctx, p, len(packed_bytes), &off) # <<<<<<<<<<<<<<
|
||||||
* return <object> template_data(&ctx)
|
* return template_data(&ctx)
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
__pyx_t_2 = PyObject_Length(__pyx_v_packed_bytes); if (unlikely(__pyx_t_2 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 185; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
|
__pyx_t_2 = PyObject_Length(__pyx_v_packed_bytes); if (unlikely(__pyx_t_2 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 185; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
|
||||||
@ -1769,19 +1769,21 @@ static PyObject *__pyx_pf_7msgpack_unpacks(PyObject *__pyx_self, PyObject *__pyx
|
|||||||
/* "/home/inada-n/work/msgpack.py/python/msgpack.pyx":186
|
/* "/home/inada-n/work/msgpack.py/python/msgpack.pyx":186
|
||||||
* template_init(&ctx)
|
* template_init(&ctx)
|
||||||
* template_execute(&ctx, p, len(packed_bytes), &off)
|
* template_execute(&ctx, p, len(packed_bytes), &off)
|
||||||
* return <object> template_data(&ctx) # <<<<<<<<<<<<<<
|
* return template_data(&ctx) # <<<<<<<<<<<<<<
|
||||||
*
|
*
|
||||||
* def unpack(object stream):
|
* def unpack(object stream):
|
||||||
*/
|
*/
|
||||||
__Pyx_XDECREF(__pyx_r);
|
__Pyx_XDECREF(__pyx_r);
|
||||||
__pyx_t_3 = template_data((&__pyx_v_ctx));
|
__pyx_t_3 = template_data((&__pyx_v_ctx)); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 186; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
|
||||||
__Pyx_INCREF(((PyObject *)__pyx_t_3));
|
__Pyx_GOTREF(__pyx_t_3);
|
||||||
__pyx_r = ((PyObject *)__pyx_t_3);
|
__pyx_r = __pyx_t_3;
|
||||||
|
__pyx_t_3 = 0;
|
||||||
goto __pyx_L0;
|
goto __pyx_L0;
|
||||||
|
|
||||||
__pyx_r = Py_None; __Pyx_INCREF(Py_None);
|
__pyx_r = Py_None; __Pyx_INCREF(Py_None);
|
||||||
goto __pyx_L0;
|
goto __pyx_L0;
|
||||||
__pyx_L1_error:;
|
__pyx_L1_error:;
|
||||||
|
__Pyx_XDECREF(__pyx_t_3);
|
||||||
__Pyx_AddTraceback("msgpack.unpacks");
|
__Pyx_AddTraceback("msgpack.unpacks");
|
||||||
__pyx_r = NULL;
|
__pyx_r = NULL;
|
||||||
__pyx_L0:;
|
__pyx_L0:;
|
||||||
@ -1791,7 +1793,7 @@ static PyObject *__pyx_pf_7msgpack_unpacks(PyObject *__pyx_self, PyObject *__pyx
|
|||||||
}
|
}
|
||||||
|
|
||||||
/* "/home/inada-n/work/msgpack.py/python/msgpack.pyx":188
|
/* "/home/inada-n/work/msgpack.py/python/msgpack.pyx":188
|
||||||
* return <object> template_data(&ctx)
|
* return template_data(&ctx)
|
||||||
*
|
*
|
||||||
* def unpack(object stream): # <<<<<<<<<<<<<<
|
* def unpack(object stream): # <<<<<<<<<<<<<<
|
||||||
* """unpack from stream."""
|
* """unpack from stream."""
|
||||||
|
@ -173,7 +173,7 @@ cdef extern from "unpack.h":
|
|||||||
int template_execute(template_context* ctx, const_char_ptr data,
|
int template_execute(template_context* ctx, const_char_ptr data,
|
||||||
size_t len, size_t* off)
|
size_t len, size_t* off)
|
||||||
void template_init(template_context* ctx)
|
void template_init(template_context* ctx)
|
||||||
PyObject* template_data(template_context* ctx)
|
object template_data(template_context* ctx)
|
||||||
|
|
||||||
|
|
||||||
def unpacks(object packed_bytes):
|
def unpacks(object packed_bytes):
|
||||||
@ -183,7 +183,7 @@ def unpacks(object packed_bytes):
|
|||||||
cdef size_t off = 0
|
cdef size_t off = 0
|
||||||
template_init(&ctx)
|
template_init(&ctx)
|
||||||
template_execute(&ctx, p, len(packed_bytes), &off)
|
template_execute(&ctx, p, len(packed_bytes), &off)
|
||||||
return <object> template_data(&ctx)
|
return template_data(&ctx)
|
||||||
|
|
||||||
def unpack(object stream):
|
def unpack(object stream):
|
||||||
"""unpack from stream."""
|
"""unpack from stream."""
|
||||||
|
Loading…
x
Reference in New Issue
Block a user