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
d2c1b777
Commit
d2c1b777
authored
Aug 22, 2015
by
Stefan Behnel
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix ticket 154: C compilation error for unused local buffer variables
parent
3f684dfe
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
19 additions
and
1 deletion
+19
-1
CHANGES.rst
CHANGES.rst
+3
-0
Cython/Compiler/Nodes.py
Cython/Compiler/Nodes.py
+2
-1
tests/buffers/bufaccess.pyx
tests/buffers/bufaccess.pyx
+14
-0
No files found.
CHANGES.rst
View file @
d2c1b777
...
...
@@ -12,6 +12,9 @@ Bugs fixed
* Invalid C code for some builtin methods. This fixes ticket 856.
* Invalid C code for unused local buffer variables.
This fixes ticket 154.
* Test failures on 32bit systems. This fixes ticket 857.
* Code that uses "from xyz import *" and global C struct/union/array
...
...
Cython/Compiler/Nodes.py
View file @
d2c1b777
...
...
@@ -1955,7 +1955,8 @@ class FuncDefNode(StatNode, BlockNode):
code
.
putln
(
"{ PyObject *__pyx_type, *__pyx_value, *__pyx_tb;"
)
code
.
putln
(
"__Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb);"
)
for
entry
in
lenv
.
buffer_entries
:
Buffer
.
put_release_buffer_code
(
code
,
entry
)
if
entry
.
used
:
Buffer
.
put_release_buffer_code
(
code
,
entry
)
#code.putln("%s = 0;" % entry.cname)
code
.
putln
(
"__Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);}"
)
...
...
tests/buffers/bufaccess.pyx
View file @
d2c1b777
...
...
@@ -45,6 +45,7 @@ def nousage():
cdef
object
[
int
,
ndim
=
2
]
buf
@
testcase
def
disabled_usage
(
obj
):
"""
The challenge here is just compilation.
...
...
@@ -57,6 +58,19 @@ def disabled_usage(obj):
return
obj
@
testcase
def
nousage_cleanup
(
x
):
"""
>>> nousage_cleanup(False)
>>> nousage_cleanup(True)
Traceback (most recent call last):
RuntimeError
"""
cdef
object
[
int
,
ndim
=
2
]
buf
if
x
:
raise
RuntimeError
()
@
testcase
def
acquire_release
(
o1
,
o2
):
"""
...
...
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