Commit ab4325d1 authored by Stefan Behnel's avatar Stefan Behnel

C/C++ code fix: make sure sequence unpacking utility variable is declared at the start of a block

--HG--
extra : transplant_source : I%04%CB%02M%C5lZ-%A3%86xK%A4%C1r%B0%92%8DT
parent 34f6211d
......@@ -4084,6 +4084,8 @@ class SequenceNode(ExprNode):
code.put_incref(item.result(), item.ctype())
rhs.generate_disposal_code(code)
code.putln("} else {")
else:
code.putln("{")
if special_unpack and rhs.type is tuple_type:
code.globalstate.use_utility_code(tuple_unpacking_error_code)
......@@ -4092,7 +4094,6 @@ class SequenceNode(ExprNode):
code.putln(code.error_goto(self.pos))
else:
self.generate_generic_parallel_unpacking_code(code, rhs)
if special_unpack:
code.putln("}")
for value_node in self.coerced_unpacked_items:
......@@ -4117,7 +4118,7 @@ class SequenceNode(ExprNode):
def generate_generic_parallel_unpacking_code(self, code, rhs):
code.globalstate.use_utility_code(iternext_unpacking_end_utility_code)
code.globalstate.use_utility_code(raise_need_more_values_to_unpack)
code.putln("Py_ssize_t index = -1;")
code.putln("Py_ssize_t index = -1;") # must be at the start of a C block!
iterator_temp = code.funcstate.allocate_temp(py_object_type, manage_ref=True)
code.putln(
......
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