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
Boxiang Sun
cython
Commits
32370fe6
Commit
32370fe6
authored
Mar 24, 2012
by
Stefan Behnel
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix compiler crash in unpacking corner case
parent
91d1ed40
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
10 additions
and
14 deletions
+10
-14
Cython/Compiler/ExprNodes.py
Cython/Compiler/ExprNodes.py
+10
-14
No files found.
Cython/Compiler/ExprNodes.py
View file @
32370fe6
...
...
@@ -5075,27 +5075,21 @@ class SequenceNode(ExprNode):
for
item
in
unpacked_fixed_items_right
[::
-
1
]:
item
.
allocate
(
code
)
code
.
putln
(
'#if CYTHON_COMPILING_IN_CPYTHON'
)
for
i
,
(
item
,
coerced_arg
)
in
enumerate
(
zip
(
unpacked_fixed_items_right
[::
-
1
],
self
.
coerced_unpacked_items
[::
-
1
])):
code
.
putln
(
"%s = PyList_GET_ITEM(%s, %s-%d); "
%
(
item
.
py_result
(),
target_list
,
length_temp
,
i
+
1
))
code
.
putln
(
'#if CYTHON_COMPILING_IN_CPYTHON'
)
code
.
putln
(
"%s = PyList_GET_ITEM(%s, %s-%d); "
%
(
item
.
py_result
(),
target_list
,
length_temp
,
i
+
1
))
# resize the list the hard way
code
.
putln
(
"((PyVarObject*)%s)->ob_size--;"
%
target_list
)
code
.
putln
(
'#else'
)
code
.
putln
(
"%s = PySequence_GetItem(%s, %s-%d); "
%
(
item
.
py_result
(),
target_list
,
length_temp
,
i
+
1
))
code
.
putln
(
'#endif'
)
code
.
put_gotref
(
item
.
py_result
())
coerced_arg
.
generate_evaluation_code
(
code
)
code
.
putln
(
'#else'
)
for
i
,
(
item
,
coerced_arg
)
in
enumerate
(
zip
(
unpacked_fixed_items_right
[::
-
1
],
self
.
coerced_unpacked_items
[::
-
1
])):
code
.
putln
(
"%s = PySequence_GetItem(%s, %s-%d); "
%
(
item
.
py_result
(),
target_list
,
length_temp
,
i
+
1
))
# resize the list the hard way
code
.
put_gotref
(
item
.
py_result
())
coerced_arg
.
generate_evaluation_code
(
code
)
code
.
putln
(
'#if !CYTHON_COMPILING_IN_CPYTHON'
)
sublist_temp
=
code
.
funcstate
.
allocate_temp
(
py_object_type
,
manage_ref
=
True
)
code
.
putln
(
'%s = PyList_GetSlice(%s, 0, %s-%d); %s'
%
(
sublist_temp
,
target_list
,
length_temp
,
len
(
unpacked_fixed_items_right
),
...
...
@@ -5104,6 +5098,8 @@ class SequenceNode(ExprNode):
code
.
funcstate
.
release_temp
(
length_temp
)
code
.
put_decref
(
target_list
,
py_object_type
)
code
.
putln
(
'%s = %s; %s = NULL;'
%
(
target_list
,
sublist_temp
,
sublist_temp
))
code
.
putln
(
'#else'
)
code
.
putln
(
'%s = %s;'
%
(
sublist_temp
,
sublist_temp
))
# avoid warning about unused variable
code
.
funcstate
.
release_temp
(
sublist_temp
)
code
.
putln
(
'#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