summaryrefslogtreecommitdiff
path: root/Zend/zend_language_scanner.c
Commit message (Collapse)AuthorAgeFilesLines
* Remove generated lexerNikita Popov2020-02-281-8488/+0
| | | | Accidentially committed this when merging from 7.3.
* Merge branch 'PHP-7.3' into PHP-7.4Nikita Popov2020-02-281-0/+8488
|\ | | | | | | | | * PHP-7.3: Fixed bug #79062
| * Fixed bug #79062Nikita Popov2020-02-281-118/+121
| | | | | | | | Back up the doc comment when performing heredoc scanahead.
| * Make sure T_ERROR is returned for all lexer exceptionsNikita Popov2019-10-041-118/+133
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This originally manifested as a leak in oss-fuzz #18000. The following is a reduced test case: <?php [ 5 => 1, "foo" > 1, " " => "" == 0 ]; <<<BAR $x BAR; Because this particular error condition did not return T_ERROR, EG(exception) was set while performing binary operation constant evaluation, which checks exceptions for cast failures. Instead of adding this indirect test case, I'm adding an assertion that the lexer has to return T_ERROR if EG(exception) is set.
| * Don't throw warnings during heredoc scan-aheadNikita Popov2019-09-281-178/+182
| | | | | | | | Otherwise these warnings will turn up twice (or more...)
| * Fix #78441: Parse error due to heredoc identifier followed by digitChristoph M. Becker2019-08-211-352/+353
| | | | | | | | | | Since digits are allowed for identifiers, we have to cater to them as well.
| * Merge branch 'PHP-7.2' into PHP-7.3Nikita Popov2019-05-131-220/+221
| |\
| | * Fix #77993: Wrong parse error for invalid hex literal on WindowsTheodore Brown2019-05-131-4199/+4196
| | | | | | | | | | | | | | | | | | | | | | | | If a PHP file contains an invalid hex literal such as `0x_10`, the expected error is `Parse error: syntax error, unexpected 'x_10' (T_STRING) in %s on line %d`. This already worked correctly on Linux, but on Windows prior to this patch a different error was produced: `Parse error: Invalid numeric literal in %s on line %d`.
| | * year++Xinchen Hui2018-01-021-1/+1
| | |
| * | Future-proof email addressesZeev Suraski2018-11-011-2/+2
| | |
* | | Remove lexer files generated by RE2CPeter Kokot2018-11-111-8168/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This patch removes generated lexer files by re2c during the build process so they are not tracked by Git yet can be still shipped when PHP is released. The genfiles script additionally provides generation of these lexer files when creating a release of the PHP source code. The genfiles script refactorings: - added file header - echoing steps instead of comments - cleaning only lines starting with `#line` - eval removed in favor of direct executed commands - the debug mode `set -x` removed - script can be called from any path - improved comments
* | | Update email addresses. We're still @Zend, but future proofing it...Zeev Suraski2018-11-011-2/+2
| | |
* | | Merge branch 'PHP-7.3'Nikita Popov2018-10-101-119/+121
|\ \ \ | |/ /
| * | Fixed bug #76991Nikita Popov2018-10-101-230/+232
| | | | | | | | | | | | | | | Back up exceptions while the scan-ahead loop, to avoid an early bail out.
* | | Rename ZEND_ACC_NO_RT_ARENA into ZEND_ACC_HEAP_RT_CACHE and use it for ↵Dmitry Stogov2018-10-021-348/+351
| | | | | | | | | | | | pseudo-main op_arrays.
* | | Remove HAVE_STDARG_HPeter Kokot2018-09-181-352/+350
|/ / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The C89 standard and later defines the `<stdarg.h>` header as part of the standard headers [1]. On current systems it is always present and can be included unconditionally. Checking for presence and functionality of the `<stdarg.h>` header and variadic function is not relevant anymore on current systems since this is always available. Also Autoconf suggests relying on at least C89 or above [2] and [3]. The following files were regenerated with re2c 1.0.3: - Zend/zend_language_scanner.c - Zend/zend_language_scanner_defs.h Refs: [1] https://port70.net/~nsz/c/c89/c89-draft.html#4.1.2 [2] http://git.savannah.gnu.org/cgit/autoconf.git/tree/lib/autoconf/headers.m4 [3] https://www.gnu.org/software/autoconf/manual/autoconf-2.69/autoconf.html
* | Remove unused Git attributes identPeter Kokot2018-07-251-2/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The $Id$ keywords were used in Subversion where they can be substituted with filename, last revision number change, last changed date, and last user who changed it. In Git this functionality is different and can be done with Git attribute ident. These need to be defined manually for each file in the .gitattributes file and are afterwards replaced with 40-character hexadecimal blob object name which is based only on the particular file contents. This patch simplifies handling of $Id$ keywords by removing them since they are not used anymore.
* | Replace legacy zval_dtor() by zval_ptr_dtor_nogc() or even more specialized ↵Dmitry Stogov2018-07-041-2/+2
| | | | | | | | | | | | | | destructors. zval_dtor() doesn't make a lot of sense in PHP-7.* and it's used incorrectly in some places. Its occurances should be replaced by zval_ptr_dtor() or zval_ptr_dtor_nogc(), or even more specialized destructors.
* | Fixed bug #76439Nikita Popov2018-06-271-4410/+4434
| |
* | use defined macroXinchen Hui2018-06-181-5/+5
| |
* | Use zend_string_release_ex() instread of zend_string_release() in places, ↵Dmitry Stogov2018-05-281-3/+3
| | | | | | | | where we sure about string persistence.
* | Avoid useless checks, using zend_string_efree(), in cases where the string ↵Dmitry Stogov2018-05-081-2/+2
| | | | | | | | is known to be a temporary allocated zend_string.
* | Implement flexible heredoc/nowdoc syntaxThomas Punt2018-04-131-395/+629
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | RFC: https://wiki.php.net/rfc/flexible_heredoc_nowdoc_syntaxes * The ending label no longer has to be followed by a semicolon or newline. Any non-label character is fine. * The ending label may be indented. The indentation will be stripped from all lines in the heredoc/nowdoc string. Lexing of heredoc strings performs a scan-ahead to determine the indentation of the ending label, so that the correct amount of indentation can be removed when calculting the semantic values for use by the parser. This makes the implementation quite a bit more complicated than we would like :/
* | Optmized AST creationDmitry Stogov2018-03-151-1/+1
| |
* | PHP scanner optimizationDmitry Stogov2018-03-151-386/+423
| |
* | PHP scanner optimizationDmitry Stogov2018-03-141-413/+415
| |
* | PHP scanner optimizationDmitry Stogov2018-03-141-368/+440
| |
* | Revert "Handle scanner error in first place (don't hide them from ↵Dmitry Stogov2018-03-141-207/+195
| | | | | | | | | | | | ext/tokenizer) and cheaper whitespace handlig." This reverts commit 0d6da03f5c3e49b92cf6817ba8a7f8d6f60ee1aa.
* | Handle scanner error in first place (don't hide them from ext/tokenizer) and ↵Dmitry Stogov2018-03-131-195/+207
| | | | | | | | cheaper whitespace handlig.
* | Eliminate duplicationDmitry Stogov2018-01-171-585/+595
| |
* | Trailing whitespacesGabriel Caruso2018-01-031-224/+224
| | | | | | | | Signed-off-by: Gabriel Caruso <carusogabriel34@gmail.com>
* | year++Xinchen Hui2018-01-021-1/+1
| |
* | Cleanup type conversionDmitry Stogov2017-12-071-351/+349
|/
* Merge branch 'PHP-7.1' into PHP-7.2Xinchen Hui2017-07-211-196/+194
|\ | | | | | | | | | | | | | | | | * PHP-7.1: Update NEWS Fixed bug #74947 (Segfault in scanner on INF number) Conflicts: Zend/zend_language_scanner.c
| * Merge branch 'PHP-7.0' into PHP-7.1Xinchen Hui2017-07-211-196/+194
| |\ | | | | | | | | | | | | | | | | | | | | | * PHP-7.0: Fixed bug #74947 (Segfault in scanner on INF number) Conflicts: Zend/zend_language_scanner.c
| | * Fixed bug #74947 (Segfault in scanner on INF number)Xinchen Hui2017-07-211-196/+194
| | |
* | | Merge branch 'PHP-7.1'Nikita Popov2017-03-231-1/+1
|\ \ \ | |/ /
| * | Merge branch 'PHP-7.0' into PHP-7.1Nikita Popov2017-03-231-3959/+4147
| |\ \ | | |/
| | * Fix sequencing UBNikita Popov2017-03-231-421/+444
| | |
| | * Update copyright headers to 2017Sammy Kaye Powers2017-01-041-1/+1
| | |
| | * Fix line number of implicit return in pseudo-main scopeNikita Popov2016-10-121-3956/+4124
| | |
| * | Update copyright headers to 2017Sammy Kaye Powers2017-01-041-1/+1
| | |
* | | Fixed bug #74300xKhorasan2017-03-231-421/+444
| | |
* | | Simplify increment_lineno handlingNikita Popov2017-03-221-130/+133
| | |
* | | Resolve conflictSammy Kaye Powers2017-01-031-3929/+4094
|\ \ \
| * | | updating cvs revisions of strlcat/cpyDavid Carlier2016-10-201-3929/+4094
| |/ /
* | | Update copyright headers to 2017Sammy Kaye Powers2017-01-021-1/+1
|/ /
* | Implement #72918: negative offset inside a quoted string leads to parse errorChristoph M. Becker2016-10-141-4094/+3929
| | | | | | | | | | We allow negative numeric offsets for the simple syntax inside double-quoted and heredoc strings.
* | Merge branch 'PHP-7.0' into PHP-7.1Nikita Popov2016-10-141-3964/+4131
| | | | | | | | (cherry picked from commit 26964ccea0f52ed4d6beda3bcfd1508f6d3dad43)
* | Make sure TOKEN_PARSE mode is thread safeNikita Popov2016-07-231-350/+356
| | | | | | | | | | | | Introduce an on_event_context passed to the on_event hook. Use this context to pass along the token array. Previously this was stored in a non-tls global :/