Commit 18a182e9 authored by gsamain's avatar gsamain

Make args lock depend on their const-ness

parent dea8da4d
...@@ -2599,7 +2599,8 @@ class CFuncDefNode(FuncDefNode): ...@@ -2599,7 +2599,8 @@ class CFuncDefNode(FuncDefNode):
entry.is_variable = 1 entry.is_variable = 1
# Even if it is checklock it should be OK to mess with self without locking # 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 = 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): def declare_cpdef_wrapper(self, env):
if self.overridable: if self.overridable:
......
...@@ -1825,7 +1825,8 @@ class LocalScope(Scope): ...@@ -1825,7 +1825,8 @@ class LocalScope(Scope):
entry.is_arg = 1 entry.is_arg = 1
if type.is_cyp_class and type.lock_mode == "autolock": if type.is_cyp_class and type.lock_mode == "autolock":
arg_lock_state = self.declare_tracked(entry) 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 #entry.borrowed = 1 # Not using borrowed arg refs for now
self.arg_entries.append(entry) self.arg_entries.append(entry)
return 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