Commit daa3ce36 authored by gsamain's avatar gsamain Committed by Xavier Thompson

Make args lock depend on their const-ness

parent 1a0a71d1
......@@ -2643,7 +2643,8 @@ class CFuncDefNode(FuncDefNode):
entry.is_variable = 1
# Even if it is checklock it should be OK to mess with self without locking
self_locking_state = self.local_scope.declare_tracked(entry)
self_locking_state.is_wlocked = True
self_locking_state.is_rlocked = self.is_const_method
self_locking_state.is_wlocked = not self.is_const_method
def declare_cpdef_wrapper(self, env):
if self.overridable:
......
......@@ -1908,7 +1908,8 @@ class LocalScope(Scope):
entry.is_arg = 1
if type.is_cyp_class and type.lock_mode == "autolock":
arg_lock_state = self.declare_tracked(entry)
arg_lock_state.is_wlocked = True
arg_lock_state.is_rlocked = type.is_const
arg_lock_state.is_wlocked = not type.is_const
#entry.borrowed = 1 # Not using borrowed arg refs for now
self.arg_entries.append(entry)
return entry
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment