Commit 9478c113 authored by Xavier Thompson's avatar Xavier Thompson

Ensure sequences are properly read-locked in for-loops

parent ebdc01e6
...@@ -2837,6 +2837,17 @@ class IteratorNode(ExprNode): ...@@ -2837,6 +2837,17 @@ class IteratorNode(ExprNode):
return sequence_type return sequence_type
return py_object_type return py_object_type
def ensure_rhs_locked(self, env, is_dereferenced = False):
self.sequence.ensure_rhs_locked(env, is_dereferenced = True)
if not self.tracked_state:
self.get_tracked_state(env)
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)")
elif self.is_autolock():
self.set_autorlock(env)
def analyse_cpp_types(self, env): def analyse_cpp_types(self, env):
sequence_type = self.sequence.type sequence_type = self.sequence.type
if sequence_type.is_ptr: if sequence_type.is_ptr:
......
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