Commit bef06c19 authored by Stefan Behnel's avatar Stefan Behnel

avoid generating dead temp cleanup code after except blocks that return/break/continue at the end

parent f3684727
...@@ -6493,6 +6493,7 @@ class ExceptClauseNode(Node): ...@@ -6493,6 +6493,7 @@ class ExceptClauseNode(Node):
code.funcstate.exc_vars = exc_vars code.funcstate.exc_vars = exc_vars
self.body.generate_execution_code(code) self.body.generate_execution_code(code)
code.funcstate.exc_vars = old_exc_vars code.funcstate.exc_vars = old_exc_vars
if not self.body.is_terminator:
for var in exc_vars: for var in exc_vars:
code.put_decref_clear(var, py_object_type) code.put_decref_clear(var, py_object_type)
code.put_goto(end_label) code.put_goto(end_label)
......
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