Commit 1c157dc1 authored by Stefan Behnel's avatar Stefan Behnel

fix tweak: closure variables are not safe as function arguments; the last argument is safe, too

parent 6f8179ed
......@@ -2977,12 +2977,12 @@ class SimpleCallNode(CallNode):
# if some args are temps and others are not, they may get
# constructed in the wrong order (temps first) => make
# sure they are either all temps or all not temps
for i in range(min(max_nargs, actual_nargs)):
for i in range(min(max_nargs, actual_nargs)-1):
arg = self.args[i]
if arg.is_name and arg.entry and (
arg.entry.is_local or arg.entry.in_closure or arg.entry.type.is_cfunction):
# local variables are safe
# TODO: what about the non-local keyword?
(arg.entry.is_local and not arg.entry.in_closure)
or arg.entry.type.is_cfunction):
# local variables and C functions are safe
pass
elif env.nogil and arg.type.is_pyobject:
# can't copy a Python reference into a temp in nogil
......
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