Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
C
cython
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Gwenaël Samain
cython
Commits
9f18281a
Commit
9f18281a
authored
Sep 13, 2017
by
Ronan Lamy
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix segfault on PyPy3 when passing NULL method_name to _Pyx_dict_iterator
parent
d2653b4d
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
12 additions
and
10 deletions
+12
-10
Cython/Utility/Optimize.c
Cython/Utility/Optimize.c
+12
-10
No files found.
Cython/Utility/Optimize.c
View file @
9f18281a
...
@@ -294,18 +294,20 @@ static CYTHON_INLINE PyObject* __Pyx_dict_iterator(PyObject* iterable, int is_di
...
@@ -294,18 +294,20 @@ static CYTHON_INLINE PyObject* __Pyx_dict_iterator(PyObject* iterable, int is_di
// On PyPy3, we need to translate manually a few method names.
// On PyPy3, we need to translate manually a few method names.
// This logic is not needed on CPython thanks to the fast case above.
// This logic is not needed on CPython thanks to the fast case above.
static
PyObject
*
py_items
=
NULL
,
*
py_keys
=
NULL
,
*
py_values
=
NULL
;
static
PyObject
*
py_items
=
NULL
,
*
py_keys
=
NULL
,
*
py_values
=
NULL
;
const
char
*
name
=
PyUnicode_AsUTF8
(
method_name
);
PyObject
**
pp
=
NULL
;
PyObject
**
pp
=
NULL
;
if
(
strcmp
(
name
,
"iteritems"
)
==
0
)
pp
=
&
py_items
;
if
(
method_name
)
{
else
if
(
strcmp
(
name
,
"iterkeys"
)
==
0
)
pp
=
&
py_keys
;
const
char
*
name
=
PyUnicode_AsUTF8
(
method_name
);
else
if
(
strcmp
(
name
,
"itervalues"
)
==
0
)
pp
=
&
py_values
;
if
(
strcmp
(
name
,
"iteritems"
)
==
0
)
pp
=
&
py_items
;
if
(
pp
)
{
else
if
(
strcmp
(
name
,
"iterkeys"
)
==
0
)
pp
=
&
py_keys
;
if
(
!*
pp
)
{
else
if
(
strcmp
(
name
,
"itervalues"
)
==
0
)
pp
=
&
py_values
;
*
pp
=
PyUnicode_FromString
(
name
+
4
);
if
(
pp
)
{
if
(
!*
pp
)
if
(
!*
pp
)
{
return
NULL
;
*
pp
=
PyUnicode_FromString
(
name
+
4
);
if
(
!*
pp
)
return
NULL
;
}
method_name
=
*
pp
;
}
}
method_name
=
*
pp
;
}
}
#endif
#endif
}
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment