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
Kirill Smelkov
cython
Commits
abcfc6cc
Commit
abcfc6cc
authored
7 years ago
by
Stefan Behnel
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Reset temps to 0 after use in buffer re-assignment code.
parent
baeb5be4
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
8 additions
and
7 deletions
+8
-7
Cython/Compiler/Buffer.py
Cython/Compiler/Buffer.py
+8
-7
No files found.
Cython/Compiler/Buffer.py
View file @
abcfc6cc
...
...
@@ -384,18 +384,19 @@ def put_assign_to_buffer(lhs_cname, rhs_cname, buf_entry,
# before raising the exception. A failure of reacquisition
# will cause the reacquisition exception to be reported, one
# can consider working around this later.
type
,
value
,
tb
=
[
code
.
funcstate
.
allocate_temp
(
PyrexTypes
.
py_object_type
,
manage_ref
=
False
)
for
i
in
range
(
3
)]
code
.
putln
(
'PyErr_Fetch(&%s, &%s, &%s);'
%
(
type
,
value
,
tb
)
)
exc_temps
=
tuple
(
code
.
funcstate
.
allocate_temp
(
PyrexTypes
.
py_object_type
,
manage_ref
=
False
)
for
_
in
range
(
3
))
code
.
putln
(
'PyErr_Fetch(&%s, &%s, &%s);'
%
exc_temps
)
code
.
putln
(
'if (%s) {'
%
code
.
unlikely
(
"%s == -1"
%
(
getbuffer
%
lhs_cname
)))
code
.
putln
(
'Py_XDECREF(%s); Py_XDECREF(%s); Py_XDECREF(%s);'
%
(
type
,
value
,
tb
))
# Do not refnanny these!
code
.
putln
(
'Py_XDECREF(%s); Py_XDECREF(%s); Py_XDECREF(%s);'
%
exc_temps
)
# Do not refnanny these!
code
.
globalstate
.
use_utility_code
(
raise_buffer_fallback_code
)
code
.
putln
(
'__Pyx_RaiseBufferFallbackError();'
)
code
.
putln
(
'} else {'
)
code
.
putln
(
'PyErr_Restore(%s, %s, %s);'
%
(
type
,
value
,
tb
))
for
t
in
(
type
,
value
,
tb
):
code
.
funcstate
.
release_temp
(
t
)
code
.
putln
(
'PyErr_Restore(%s, %s, %s);'
%
exc_temps
)
code
.
putln
(
'}'
)
code
.
putln
(
'%s = %s = %s = 0;'
%
exc_temps
)
for
t
in
exc_temps
:
code
.
funcstate
.
release_temp
(
t
)
code
.
putln
(
'}'
)
# Unpack indices
put_unpack_buffer_aux_into_scope
(
buf_entry
,
code
)
...
...
This diff is collapsed.
Click to expand it.
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