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
02f3a677
Commit
02f3a677
authored
Jun 06, 2019
by
gsamain
Committed by
Xavier Thompson
Aug 17, 2020
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix lock analysis relying on too restrictive checks
parent
b8a095ee
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
4 additions
and
4 deletions
+4
-4
Cython/Compiler/ExprNodes.py
Cython/Compiler/ExprNodes.py
+4
-4
No files found.
Cython/Compiler/ExprNodes.py
View file @
02f3a677
...
...
@@ -742,7 +742,7 @@ class ExprNode(Node):
return
self
.
type
.
is_cyp_class
and
self
.
type
.
lock_mode
==
"checklock"
def
get_tracked_state
(
self
,
env
):
if
not
hasattr
(
self
,
'entry'
)
or
not
self
.
entry
.
type
.
is_cyp_class
:
if
not
hasattr
(
self
,
'entry'
)
or
not
self
.
entry
or
not
self
.
entry
.
type
.
is_cyp_class
:
return
self
.
tracked_state
=
env
.
lookup_tracked
(
self
.
entry
)
if
self
.
tracked_state
is
None
:
...
...
@@ -778,7 +778,7 @@ class ExprNode(Node):
self
.
ensure_subexpr_rhs_locked
(
env
)
if
not
self
.
tracked_state
:
self
.
get_tracked_state
(
env
)
if
is_dereferenced
:
if
is_dereferenced
and
self
.
tracked_state
:
if
not
self
.
is_rhs_locked
(
env
):
if
self
.
is_checklock
():
error
(
self
.
pos
,
"This expression is not correctly locked (read lock needed)"
)
...
...
@@ -789,7 +789,7 @@ class ExprNode(Node):
self
.
ensure_subexpr_lhs_locked
(
env
)
if
not
self
.
tracked_state
:
self
.
get_tracked_state
(
env
)
if
is_dereferenced
:
if
is_dereferenced
and
self
.
tracked_state
:
if
not
self
.
is_lhs_locked
(
env
):
if
self
.
is_checklock
():
error
(
self
.
pos
,
"This expression is not correctly locked (write lock needed)"
)
...
...
@@ -7456,7 +7456,7 @@ class AttributeNode(ExprNode):
gil_message
=
"Accessing Python attribute"
def
ensure_subexpr_rhs_locked
(
self
,
env
):
if
self
.
entry
.
is_cfunction
and
not
self
.
entry
.
type
.
is_const_method
:
if
not
self
.
entry
or
self
.
entry
.
is_cfunction
and
not
self
.
entry
.
type
.
is_const_method
:
self
.
obj
.
ensure_lhs_locked
(
env
,
is_dereferenced
=
True
)
else
:
self
.
obj
.
ensure_rhs_locked
(
env
,
is_dereferenced
=
True
)
...
...
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