Fixed segfault on 32 bit arch (wrong place for refcount increment).

parent f5301e6a
...@@ -101,13 +101,13 @@ cdef public object py_callback(object parser, char *target, int option, \ ...@@ -101,13 +101,13 @@ cdef public object py_callback(object parser, char *target, int option, \
for i in range(nargs): for i in range(nargs):
termname = <char*>va_arg(ap, str_type) termname = <char*>va_arg(ap, str_type)
Py_INCREF(termname)
PyList_SetItem(names, i, termname) PyList_SetItem(names, i, termname)
Py_INCREF(termname)
val = <void *>va_arg(ap, void_type) val = <void *>va_arg(ap, void_type)
valobj = <object>val valobj = <object>val
Py_INCREF(valobj)
PyList_SetItem(values, i, valobj) PyList_SetItem(values, i, valobj)
Py_INCREF(valobj)
#if parser.verbose: #if parser.verbose:
# print 'py_callback: calling handler:', \ # print 'py_callback: calling handler:', \
...@@ -115,12 +115,12 @@ cdef public object py_callback(object parser, char *target, int option, \ ...@@ -115,12 +115,12 @@ cdef public object py_callback(object parser, char *target, int option, \
# Set the signal handler and a timeout alarm # Set the signal handler and a timeout alarm
signal.signal(signal.SIGALRM, parser.handle_timeout) #signal.signal(signal.SIGALRM, parser.handle_timeout)
signal.alarm(parser.timeout) #signal.alarm(parser.timeout)
res = parser._handle(target, option, names, values) res = parser._handle(target, option, names, values)
signal.alarm(0) #signal.alarm(0)
#if parser.verbose: #if parser.verbose:
# print 'py_callback: handler returned:', res # print 'py_callback: handler returned:', res
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment