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
adbe80ea
Commit
adbe80ea
authored
May 25, 2013
by
Vitja Makarov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Disallow deletion of C global variables
parent
ab3434c3
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
6 additions
and
1 deletion
+6
-1
Cython/Compiler/Nodes.py
Cython/Compiler/Nodes.py
+2
-1
tests/errors/e_del.pyx
tests/errors/e_del.pyx
+4
-0
No files found.
Cython/Compiler/Nodes.py
View file @
adbe80ea
...
...
@@ -4848,7 +4848,8 @@ class DelStatNode(StatNode):
arg
=
self
.
args
[
i
]
=
arg
.
analyse_target_expression
(
env
,
None
)
if
arg
.
type
.
is_pyobject
or
(
arg
.
is_name
and
arg
.
type
.
is_memoryviewslice
):
pass
if
arg
.
is_name
and
arg
.
entry
.
is_cglobal
:
error
(
arg
.
pos
,
"Deletion of global C variable"
)
elif
arg
.
type
.
is_ptr
and
arg
.
type
.
base_type
.
is_cpp_class
:
self
.
cpp_check
(
env
)
elif
arg
.
type
.
is_cpp_class
:
...
...
tests/errors/e_del.pyx
View file @
adbe80ea
...
...
@@ -19,6 +19,9 @@ def outer(a):
del
a
return
inner
()
cdef
object
g
del
g
_ERRORS
=
u"""
10:9: Cannot assign to or delete this
...
...
@@ -26,4 +29,5 @@ _ERRORS = u"""
13:9: Deletion of non-Python, non-C++ object
14:9: Deletion of non-Python, non-C++ object
19:9: can not delete variable 'a' referenced in nested scope
23:5: Deletion of global C variable
"""
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