get rid of 'yellow last line' problem by assigning the function exit error handling...
authorStefan Behnel <stefan_ml@behnel.de>
Sun, 1 Dec 2013 08:19:03 +0000 (09:19 +0100)
committerStefan Behnel <stefan_ml@behnel.de>
Sun, 1 Dec 2013 08:19:03 +0000 (09:19 +0100)
Cython/Compiler/Nodes.py

index 8f3294b..d4c820e 100644 (file)
@@ -1749,8 +1749,11 @@ class FuncDefNode(StatNode, BlockNode):
         # -------------------------
         self.generate_function_body(env, code)
 
-        # ----- Default return value
+        code.mark_pos(self.pos)
         code.putln("")
+        code.putln("/* function exit code */")
+
+        # ----- Default return value
         if self.return_type.is_pyobject:
             #if self.return_type.is_extension_type:
             #    lhs = "(PyObject *)%s" % Naming.retval_cname
@@ -2975,6 +2978,10 @@ class DefNodeWrapper(FuncDefNode):
         # ----- Go back and insert temp variable declarations
         tempvardecl_code.put_temp_declarations(code.funcstate)
 
+        code.mark_pos(self.pos)
+        code.putln("")
+        code.putln("/* function exit code */")
+
         # ----- Error cleanup
         if code.error_label in code.labels_used:
             code.put_goto(code.return_label)
@@ -3788,6 +3795,11 @@ class GeneratorBodyDefNode(DefNode):
                 lenv.scope_class.type.declaration_code(Naming.cur_scope_cname),
                 lenv.scope_class.type.cast_code('%s->closure' %
                                                 Naming.generator_cname)))
+
+        code.mark_pos(self.pos)
+        code.putln("")
+        code.putln("/* function exit code */")
+
         # on normal generator termination, we do not take the exception propagation
         # path: no traceback info is required and not creating it is much faster
         code.putln('PyErr_SetNone(PyExc_StopIteration);')