Commit d05c5e3b authored by Stefan Behnel's avatar Stefan Behnel

avoid unnecessary safety temping of function arguments during coercions

parent 87ccc971
...@@ -7390,7 +7390,7 @@ class TypecastNode(ExprNode): ...@@ -7390,7 +7390,7 @@ class TypecastNode(ExprNode):
return self.operand.is_simple() return self.operand.is_simple()
def nonlocally_immutable(self): def nonlocally_immutable(self):
return self.operand.nonlocally_immutable() return self.is_temp or self.operand.nonlocally_immutable()
def nogil_check(self, env): def nogil_check(self, env):
if self.type and self.type.is_pyobject and self.is_temp: if self.type and self.type.is_pyobject and self.is_temp:
...@@ -9295,6 +9295,9 @@ class PyTypeTestNode(CoercionNode): ...@@ -9295,6 +9295,9 @@ class PyTypeTestNode(CoercionNode):
def is_ephemeral(self): def is_ephemeral(self):
return self.arg.is_ephemeral() return self.arg.is_ephemeral()
def nonlocally_immutable(self):
return super(PyTypeTestNode, self).nonlocally_immutable() or self.arg.nonlocally_immutable()
def calculate_constant_result(self): def calculate_constant_result(self):
# FIXME # FIXME
pass pass
...@@ -9351,6 +9354,9 @@ class NoneCheckNode(CoercionNode): ...@@ -9351,6 +9354,9 @@ class NoneCheckNode(CoercionNode):
def result_in_temp(self): def result_in_temp(self):
return self.arg.result_in_temp() return self.arg.result_in_temp()
def nonlocally_immutable(self):
return super(NoneCheckNode, self).nonlocally_immutable() or self.arg.nonlocally_immutable()
def calculate_result_code(self): def calculate_result_code(self):
return self.arg.result() return self.arg.result()
......
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