Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 12 additions & 0 deletions Zend/tests/oss-fuzz-539121135.phpt
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
--TEST--
OSS-Fuzz-539121135: Use-of-uninitialized-value ast->lineno
--FILE--
<?php

namespace {}

''

?>
--EXPECTF--
Fatal error: No code may exist outside of namespace {} in %s on line %d
2 changes: 1 addition & 1 deletion Zend/zend_compile.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
4 changes: 2 additions & 2 deletions docs/source/miscellaneous/writing-tests.rst
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down