Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
C
cython
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container registry
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
OpenVMS
Python
Modules
cython
Commits
57995c0051cf
Commit
57995c0051cf
authored
5 years ago
by
Stefan Behnel
Browse files
Options
Downloads
Patches
Plain Diff
Validate that all temps were correctly released at the end of a function.
parent
ad731131481e
No related branches found
No related tags found
No related merge requests found
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
Cython/Compiler/Code.py
+15
-0
15 additions, 0 deletions
Cython/Compiler/Code.py
with
15 additions
and
0 deletions
Cython/Compiler/Code.py
+
15
−
0
View file @
57995c00
...
...
@@ -735,6 +735,20 @@
self
.
should_declare_error_indicator
=
False
self
.
uses_error_indicator
=
False
# safety checks
def
validate_exit
(
self
):
# validate that all allocated temps have been freed
if
self
.
temps_allocated
:
leftovers
=
set
(
self
.
all_managed_temps
()).
difference
(
self
.
all_free_managed_temps
())
if
leftovers
:
msg
=
"
Temps left over at end of
'
%s
'
: %s
"
%
(
self
.
scope
.
name
,
'
,
'
.
join
(
map
(
str
,
sorted
(
leftovers
,
key
=
operator
.
itemgetter
(
0
)))),
)
print
(
msg
)
#raise RuntimeError(msg)
# labels
def
new_label
(
self
,
name
=
None
):
...
...
@@ -1860,6 +1874,7 @@
self
.
funcstate
=
FunctionState
(
self
,
scope
=
scope
)
def
exit_cfunc_scope
(
self
):
self
.
funcstate
.
validate_exit
()
self
.
funcstate
=
None
# constant handling
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment