Implicit return should be always on the last line of a function
authorBob Weinand <bobwei9@hotmail.com>
Fri, 31 Jul 2015 00:44:42 +0000 (02:44 +0200)
committerBob Weinand <bobwei9@hotmail.com>
Fri, 31 Jul 2015 00:44:42 +0000 (02:44 +0200)
Zend/zend_compile.c

index f6d9e5277777b2d75170e6ed72453d4e7a14a950..5d7eec2412cd66b74e64f44112a94bf03dd3bba5 100644 (file)
@@ -4848,6 +4848,9 @@ void zend_compile_func_decl(znode *result, zend_ast *ast) /* {{{ */
                        CG(active_class_entry), (zend_function *) op_array, E_COMPILE_ERROR);
        }
 
+       /* put the implicit return on the really last line */
+       CG(zend_lineno) = decl->end_lineno;
+
        zend_do_extended_info();
        zend_emit_final_return(NULL);