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
d4266bc6
Commit
d4266bc6
authored
Jun 01, 2020
by
Xavier Thompson
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix cypclass arguments of def methods being unlocked when already unlocked
parent
c8e408aa
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
14 additions
and
2 deletions
+14
-2
Cython/Compiler/Nodes.py
Cython/Compiler/Nodes.py
+1
-1
Cython/Compiler/Symtab.py
Cython/Compiler/Symtab.py
+9
-1
Cython/Utility/CyObjects.cpp
Cython/Utility/CyObjects.cpp
+4
-0
No files found.
Cython/Compiler/Nodes.py
View file @
d4266bc6
...
...
@@ -3331,7 +3331,7 @@ class DefNode(FuncDefNode):
if
not
arg
.
name
:
error
(
arg
.
pos
,
"Missing argument name"
)
if
arg
.
needs_conversion
:
arg
.
entry
=
env
.
declare_var
(
arg
.
name
,
arg
.
type
,
arg
.
pos
)
arg
.
entry
=
env
.
declare_var
(
arg
.
name
,
arg
.
type
,
arg
.
pos
,
is_converted_arg
=
1
)
if
arg
.
type
.
is_pyobject
:
arg
.
entry
.
init
=
"0"
else
:
...
...
Cython/Compiler/Symtab.py
View file @
d4266bc6
...
...
@@ -1970,7 +1970,8 @@ class LocalScope(Scope):
def
declare_var
(
self
,
name
,
type
,
pos
,
cname
=
None
,
visibility
=
'private'
,
api
=
0
,
in_pxd
=
0
,
is_cdef
=
0
):
api
=
0
,
in_pxd
=
0
,
is_cdef
=
0
,
is_converted_arg
=
0
):
# Add an entry for a local variable.
if
visibility
in
(
'public'
,
'readonly'
):
error
(
pos
,
"Local variable cannot be declared %s"
%
visibility
)
...
...
@@ -1983,6 +1984,13 @@ class LocalScope(Scope):
entry
.
in_with_gil_block
=
self
.
_in_with_gil_block
self
.
var_entries
.
append
(
entry
)
# arguments converted as variables should still be locked as arguments
if
is_converted_arg
and
type
.
is_cyp_class
and
type
.
lock_mode
!=
"nolock"
:
arg_lock_state
=
self
.
declare_tracked
(
entry
)
arg_lock_state
.
is_rlocked
=
type
.
is_const
arg_lock_state
.
is_wlocked
=
not
type
.
is_const
return
entry
def
declare_global
(
self
,
name
,
pos
):
...
...
Cython/Utility/CyObjects.cpp
View file @
d4266bc6
...
...
@@ -367,6 +367,10 @@ void RecursiveUpgradeableRWLock::unlock() {
else
if
(
has_write_lock
)
{
--
my_counts
.
write_count
;
}
else
{
fprintf
(
stderr
,
"ERROR: trying to unlock already unlocked CyObject !
\n
"
);
return
;
}
if
(
!
my_counts
.
write_count
&&
!
my_counts
.
read_count
)
{
pthread_rwlock_unlock
(
&
this
->
rw_lock
);
my_counts
.
thread_id
=
0
;
...
...
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