diff --git a/Zend/tests/oss-fuzz-539121135.phpt b/Zend/tests/oss-fuzz-539121135.phpt new file mode 100644 index 000000000000..bf44d659cd7b --- /dev/null +++ b/Zend/tests/oss-fuzz-539121135.phpt @@ -0,0 +1,12 @@ +--TEST-- +OSS-Fuzz-539121135: Use-of-uninitialized-value ast->lineno +--FILE-- + +--EXPECTF-- +Fatal error: No code may exist outside of namespace {} in %s on line %d diff --git a/Zend/zend_compile.c b/Zend/zend_compile.c index 450b192ac482..2466710f9cee 100644 --- a/Zend/zend_compile.c +++ b/Zend/zend_compile.c @@ -12215,7 +12215,7 @@ static void zend_compile_stmt(zend_ast *ast) /* {{{ */ return; } - CG(zend_lineno) = ast->lineno; + CG(zend_lineno) = zend_ast_get_lineno(ast); if ((CG(compiler_options) & ZEND_COMPILE_EXTENDED_STMT) && !zend_is_unticked_stmt(ast)) { zend_do_extended_stmt(NULL); diff --git a/docs/source/miscellaneous/writing-tests.rst b/docs/source/miscellaneous/writing-tests.rst index fb66db79e57c..7365267648a9 100644 --- a/docs/source/miscellaneous/writing-tests.rst +++ b/docs/source/miscellaneous/writing-tests.rst @@ -237,8 +237,8 @@ and not in the INI section. This is because of the order in which settings are c If a TZ environmental variable is found the INI setting will be ignored. -Tests that run, or only have matching EXPECT output, on 32bit platforms can use a SKIPIF -section like: +Tests that run, or only have matching EXPECT output, on 32bit platforms can use a SKIPIF section +like: .. code:: php