Patch loop.c to fix a segfault in Cython.

This commit is contained in:
Yury Selivanov 2016-05-14 17:40:00 -04:00
parent fa5ab57050
commit eb7a23df4c
1 changed files with 17 additions and 0 deletions

View File

@ -84,6 +84,23 @@ src = re.sub(
src, flags=re.X)
# Fix a segfault in Cython.
src = re.sub(
r'''
\s* __Pyx_Coroutine_get_qualname\(__pyx_CoroutineObject\s+\*self\)
\s* {
\s* Py_INCREF\(self->gi_qualname\);
''',
r'''
__Pyx_Coroutine_get_qualname(__pyx_CoroutineObject *self)
{
if (self->gi_qualname == NULL) { return __pyx_empty_unicode; }
Py_INCREF(self->gi_qualname);
''',
src, flags=re.X)
with open('uvloop/loop.c', 'wt') as f:
f.write(src)
endef