Commit 7611da16 authored by gsamain's avatar gsamain Committed by Xavier Thompson

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

parent d91d718f
...@@ -6224,6 +6224,10 @@ class SimpleCallNode(CallNode): ...@@ -6224,6 +6224,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.type.is_pyobject and self.result(): if self.type.is_pyobject and self.result():
self.generate_gotref(code) self.generate_gotref(code)
elif self.type.is_cyp_class and self.result(): elif self.type.is_cyp_class and self.result():
...@@ -6231,6 +6235,10 @@ class SimpleCallNode(CallNode): ...@@ -6231,6 +6235,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