Commit 4b61de60 authored by Stefan Behnel's avatar Stefan Behnel

Fix "declaration after code" issue.

Closes #1801
parent 019f9ff5
...@@ -12,6 +12,9 @@ Features added ...@@ -12,6 +12,9 @@ Features added
Bugs fixed Bugs fixed
---------- ----------
* Invalid C code in generators (declaration after code).
(Github issue #1801)
* Arithmetic operations on ``const`` integer variables could generate invalid code. * Arithmetic operations on ``const`` integer variables could generate invalid code.
(Github issue #1798). (Github issue #1798).
......
...@@ -4081,7 +4081,7 @@ class GeneratorBodyDefNode(DefNode): ...@@ -4081,7 +4081,7 @@ class GeneratorBodyDefNode(DefNode):
profile = code.globalstate.directives['profile'] profile = code.globalstate.directives['profile']
linetrace = code.globalstate.directives['linetrace'] linetrace = code.globalstate.directives['linetrace']
if profile or linetrace: if profile or linetrace:
code.put_trace_declarations() tempvardecl_code.put_trace_declarations()
# ----- Resume switch point. # ----- Resume switch point.
code.funcstate.init_closure_temps(lenv.scope_class.type.scope) code.funcstate.init_closure_temps(lenv.scope_class.type.scope)
......
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