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
47563ef6
Commit
47563ef6
authored
Aug 01, 2008
by
Dag Sverre Seljebotn
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fixed bug related to non-usage of local buffer variable
parent
72accb34
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
13 additions
and
3 deletions
+13
-3
Cython/Compiler/Buffer.py
Cython/Compiler/Buffer.py
+2
-2
Cython/Compiler/Nodes.py
Cython/Compiler/Nodes.py
+2
-1
tests/run/bufaccess.pyx
tests/run/bufaccess.pyx
+9
-0
No files found.
Cython/Compiler/Buffer.py
View file @
47563ef6
...
...
@@ -63,8 +63,8 @@ class IntroduceBufferAuxiliaryVars(CythonTransform):
cname
=
scope
.
mangle
(
Naming
.
bufstruct_prefix
,
name
)
bufinfo
=
scope
.
declare_var
(
name
=
"$%s"
%
cname
,
cname
=
cname
,
type
=
PyrexTypes
.
c_py_buffer_type
,
pos
=
node
.
pos
)
bufinfo
.
used
=
True
if
entry
.
is_arg
:
bufinfo
.
used
=
True
# otherwise, NameNode will mark whether it is used
def
var
(
prefix
,
idx
,
initval
):
cname
=
scope
.
mangle
(
prefix
,
"%d_%s"
%
(
idx
,
name
))
...
...
Cython/Compiler/Nodes.py
View file @
47563ef6
...
...
@@ -935,7 +935,8 @@ class FuncDefNode(StatNode, BlockNode):
# goto statement in error cleanup above
code
.
put_label
(
code
.
return_label
)
for
entry
in
lenv
.
buffer_entries
:
code
.
putln
(
"%s;"
%
Buffer
.
get_release_buffer_code
(
entry
))
if
entry
.
used
:
code
.
putln
(
"%s;"
%
Buffer
.
get_release_buffer_code
(
entry
))
# ----- Return cleanup for both error and no-error return
code
.
put_label
(
code
.
return_from_error_cleanup_label
)
if
not
Options
.
init_local_none
:
...
...
tests/run/bufaccess.pyx
View file @
47563ef6
...
...
@@ -34,6 +34,15 @@ def testcas(a):
# Buffer acquire and release tests
#
@
testcase
def
nousage
():
"""
>>> True
True
"""
cdef
object
[
int
,
2
]
buf
# this used not to compile
@
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