Commit 7ce18eb1 authored by Stefan Behnel's avatar Stefan Behnel

Fix a C compiler warning about unused cleanup code in buffer using functions...

Fix a C compiler warning about unused cleanup code in buffer using functions that always raise (found by clang in the bufaccess.pyx test).
parent b39a5785
......@@ -2023,8 +2023,9 @@ class FuncDefNode(StatNode, BlockNode):
code.putln("%s = %s;" % (Naming.retval_cname, val))
elif not return_type.is_void:
code.putln("__Pyx_pretend_to_initialize(&%s);" % Naming.retval_cname)
# ----- Error cleanup
if code.error_label in code.labels_used:
if code.label_used(code.error_label):
if not self.body.is_terminator:
code.put_goto(code.return_label)
code.put_label(code.error_label)
......@@ -2107,6 +2108,7 @@ class FuncDefNode(StatNode, BlockNode):
def align_error_path_gil_to_success_path(): pass
# ----- Non-error return cleanup
if code.label_used(code.return_label) or not code.label_used(code.error_label):
code.put_label(code.return_label)
for entry in used_buffer_entries:
......
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