Skip to content

Commit eb7a23d

Browse files
committed
Patch loop.c to fix a segfault in Cython.
1 parent fa5ab57 commit eb7a23d

File tree

1 file changed

+17
-0
lines changed

1 file changed

+17
-0
lines changed

Makefile

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -84,6 +84,23 @@ src = re.sub(
8484

8585
src, flags=re.X)
8686

87+
# Fix a segfault in Cython.
88+
src = re.sub(
89+
r'''
90+
\s* __Pyx_Coroutine_get_qualname\(__pyx_CoroutineObject\s+\*self\)
91+
\s* {
92+
\s* Py_INCREF\(self->gi_qualname\);
93+
''',
94+
95+
r'''
96+
__Pyx_Coroutine_get_qualname(__pyx_CoroutineObject *self)
97+
{
98+
if (self->gi_qualname == NULL) { return __pyx_empty_unicode; }
99+
Py_INCREF(self->gi_qualname);
100+
''',
101+
102+
src, flags=re.X)
103+
87104
with open('uvloop/loop.c', 'wt') as f:
88105
f.write(src)
89106
endef

0 commit comments

Comments
 (0)