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
ea85d044
Commit
ea85d044
authored
Nov 02, 2009
by
Dag Sverre Seljebotn
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix #444 (utility code not pulled in in corner case)
parent
3a2a66e2
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
10 additions
and
5 deletions
+10
-5
Cython/Compiler/Buffer.py
Cython/Compiler/Buffer.py
+3
-2
Cython/Compiler/Nodes.py
Cython/Compiler/Nodes.py
+3
-3
tests/compile/bufaccess_noassignT444.pyx
tests/compile/bufaccess_noassignT444.pyx
+4
-0
No files found.
Cython/Compiler/Buffer.py
View file @
ea85d044
...
@@ -245,8 +245,9 @@ def put_acquire_arg_buffer(entry, code, pos):
...
@@ -245,8 +245,9 @@ def put_acquire_arg_buffer(entry, code, pos):
# need to care about the buffer then.
# need to care about the buffer then.
put_unpack_buffer_aux_into_scope
(
buffer_aux
,
entry
.
type
.
mode
,
code
)
put_unpack_buffer_aux_into_scope
(
buffer_aux
,
entry
.
type
.
mode
,
code
)
def
get_release_buffer_code
(
entry
):
def
put_release_buffer_code
(
code
,
entry
):
return
"__Pyx_SafeReleaseBuffer(&%s)"
%
entry
.
buffer_aux
.
buffer_info_var
.
cname
code
.
globalstate
.
use_utility_code
(
acquire_utility_code
)
code
.
putln
(
"__Pyx_SafeReleaseBuffer(&%s);"
%
entry
.
buffer_aux
.
buffer_info_var
.
cname
)
def
get_getbuffer_call
(
code
,
obj_cname
,
buffer_aux
,
buffer_type
):
def
get_getbuffer_call
(
code
,
obj_cname
,
buffer_aux
,
buffer_type
):
ndim
=
buffer_type
.
ndim
ndim
=
buffer_type
.
ndim
...
...
Cython/Compiler/Nodes.py
View file @
ea85d044
...
@@ -1142,8 +1142,8 @@ class FuncDefNode(StatNode, BlockNode):
...
@@ -1142,8 +1142,8 @@ class FuncDefNode(StatNode, BlockNode):
code
.
globalstate
.
use_utility_code
(
restore_exception_utility_code
)
code
.
globalstate
.
use_utility_code
(
restore_exception_utility_code
)
code
.
putln
(
"{ PyObject *__pyx_type, *__pyx_value, *__pyx_tb;"
)
code
.
putln
(
"{ PyObject *__pyx_type, *__pyx_value, *__pyx_tb;"
)
code
.
putln
(
"__Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb);"
)
code
.
putln
(
"__Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb);"
)
for
entry
in
lenv
.
buffer_entries
:
for
entry
in
lenv
.
buffer_entries
:
code
.
putln
(
"%s;"
%
Buffer
.
get_release_buffer_code
(
entry
)
)
Buffer
.
put_release_buffer_code
(
code
,
entry
)
#code.putln("%s = 0;" % entry.cname)
#code.putln("%s = 0;" % entry.cname)
code
.
putln
(
"__Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);}"
)
code
.
putln
(
"__Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);}"
)
...
@@ -1185,7 +1185,7 @@ class FuncDefNode(StatNode, BlockNode):
...
@@ -1185,7 +1185,7 @@ class FuncDefNode(StatNode, BlockNode):
code
.
put_label
(
code
.
return_label
)
code
.
put_label
(
code
.
return_label
)
for
entry
in
lenv
.
buffer_entries
:
for
entry
in
lenv
.
buffer_entries
:
if
entry
.
used
:
if
entry
.
used
:
code
.
putln
(
"%s;"
%
Buffer
.
get_release_buffer_code
(
entry
)
)
Buffer
.
put_release_buffer_code
(
code
,
entry
)
if
is_getbuffer_slot
:
if
is_getbuffer_slot
:
self
.
getbuffer_normal_cleanup
(
code
)
self
.
getbuffer_normal_cleanup
(
code
)
# ----- Return cleanup for both error and no-error return
# ----- Return cleanup for both error and no-error return
...
...
tests/compile/bufaccess_noassignT444.pyx
0 → 100644
View file @
ea85d044
def
test
():
cdef
object
[
int
]
not_assigned_to
not_assigned_to
[
2
]
=
3
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