Commit 4e338f74 authored by gsamain's avatar gsamain

Make SimpleCallNode be able to lock and unlock temps values discarded after call (func().attr)

parent ad29a1e1
...@@ -6130,6 +6130,10 @@ class SimpleCallNode(CallNode): ...@@ -6130,6 +6130,10 @@ class SimpleCallNode(CallNode):
else: else:
goto_error = "" goto_error = ""
code.putln("%s%s; %s" % (lhs, rhs, goto_error)) code.putln("%s%s; %s" % (lhs, rhs, goto_error))
if self.wlocked:
code.putln("Cy_WLOCK(%s);" % self.result())
elif self.rlocked:
code.putln("Cy_RLOCK(%s);" % self.result())
if self.result(): if self.result():
if self.type.is_pyobject: if self.type.is_pyobject:
code.put_gotref(self.py_result()) code.put_gotref(self.py_result())
...@@ -6138,6 +6142,10 @@ class SimpleCallNode(CallNode): ...@@ -6138,6 +6142,10 @@ class SimpleCallNode(CallNode):
if self.has_optional_args: if self.has_optional_args:
code.funcstate.release_temp(self.opt_arg_struct) code.funcstate.release_temp(self.opt_arg_struct)
def generate_disposal_code(self, code):
if self.wlocked or self.rlocked:
code.putln("Cy_UNLOCK(%s);" % self.result())
ExprNode.generate_disposal_code(self, code)
class NumPyMethodCallNode(SimpleCallNode): class NumPyMethodCallNode(SimpleCallNode):
# Pythran call to a NumPy function or method. # Pythran call to a NumPy function or method.
......
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