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
Labels
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Commits
Open sidebar
nexedi
cython
Commits
baae5864
Commit
baae5864
authored
Aug 28, 2020
by
Xavier Thompson
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix cypclass lock analysis on function calls
parent
19ec8ac4
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
8 additions
and
4 deletions
+8
-4
Cython/Compiler/CypclassTransforms.py
Cython/Compiler/CypclassTransforms.py
+7
-3
tests/errors/cypclass_lock_error.pyx
tests/errors/cypclass_lock_error.pyx
+1
-1
No files found.
Cython/Compiler/CypclassTransforms.py
View file @
baae5864
...
@@ -704,9 +704,13 @@ class CypclassLockTransform(Visitor.EnvTransform):
...
@@ -704,9 +704,13 @@ class CypclassLockTransform(Visitor.EnvTransform):
return
node
return
node
def
visit_SimpleCallNode
(
self
,
node
):
def
visit_SimpleCallNode
(
self
,
node
):
for
i
,
arg
in
enumerate
(
node
.
args
or
()):
# provide an empty tuple fallback in case node.args is None
func_type
=
node
.
function_type
()
if
arg
.
type
.
is_cyp_class
:
if
func_type
.
is_cfunction
:
node
.
args
[
i
]
=
self
.
lockcheck_written_or_read
(
arg
,
reading
=
arg
.
type
.
is_const
)
formal_nargs
=
len
(
func_type
.
args
)
actual_nargs
=
len
(
node
.
args
)
for
i
,
formal_arg
,
actual_arg
in
zip
(
range
(
actual_nargs
),
func_type
.
args
,
node
.
args
):
if
formal_arg
.
type
.
is_cyp_class
:
node
.
args
[
i
]
=
self
.
lockcheck_written_or_read
(
actual_arg
,
reading
=
formal_arg
.
type
.
is_const
)
with
self
.
accesscontext
(
reading
=
True
):
with
self
.
accesscontext
(
reading
=
True
):
self
.
visitchildren
(
node
)
self
.
visitchildren
(
node
)
return
node
return
node
...
...
tests/errors/cypclass_lock_error.pyx
View file @
baae5864
...
@@ -31,5 +31,5 @@ _ERRORS = u"""
...
@@ -31,5 +31,5 @@ _ERRORS = u"""
23:8: Reference 'obj' is not correctly locked in this expression (write lock required)
23:8: Reference 'obj' is not correctly locked in this expression (write lock required)
24:26: Reference 'obj' is not correctly locked in this expression (write lock required)
24:26: Reference 'obj' is not correctly locked in this expression (write lock required)
25:4: Reference 'obj' is not correctly locked in this expression (read lock required)
25:4: Reference 'obj' is not correctly locked in this expression (read lock required)
26:21: Reference 'obj' is not correctly locked in this expression (
write
lock required)
26:21: Reference 'obj' is not correctly locked in this expression (
read
lock required)
"""
"""
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