Commit b8672147 authored by Xavier Thompson's avatar Xavier Thompson

Fix lock-checking of subscript index in 'base[index]'

parent 814300ff
...@@ -730,7 +730,8 @@ class CypclassLockTransform(Visitor.EnvTransform): ...@@ -730,7 +730,8 @@ class CypclassLockTransform(Visitor.EnvTransform):
func_type = func_entry.type func_type = func_entry.type
node.base = self.lockcheck_written_or_read(node.base, reading=func_type.is_const_method) node.base = self.lockcheck_written_or_read(node.base, reading=func_type.is_const_method)
if len(func_type.args): if len(func_type.args):
node.index = self.lockcheck_written_or_read(node.index, reading=func_type.args[0].type.is_const) if func_type.args[0].type.is_cyp_class:
node.index = self.lockcheck_written_or_read(node.index, reading=func_type.args[0].type.is_const)
with self.accesscontext(reading=True): with self.accesscontext(reading=True):
self.visitchildren(node) self.visitchildren(node)
return node return node
......
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