Commit Graph

172 Commits

Author SHA1 Message Date
Xinchen Hui
563659822d Merge branch 'PHP-7.0' 2016-01-02 17:56:54 +08:00
Xinchen Hui
97a9470d97 bump year which is missed in rev 49493a2 2016-01-02 17:56:11 +08:00
Dmitry Stogov
998204ef2d Separate common part of compile_file() and compile_string() into zend_compile() 2015-11-12 16:59:44 +03:00
Nikita Popov
a49ce7bb91 Don't return T_ERROR from token_get_all()
This turned out to be rather inconvenient after all. Instead just
return the same output we did on PHP 5. If people want to have an
error, use TOKEN_PARSE.
2015-07-09 23:02:21 +02:00
Nikita Popov
d91aad5966 Fix bug #69430
Don't throw from token_get_all() unless TOKEN_PARSE is used. Errors
are reported as T_ERROR tokens.
2015-07-09 19:11:48 +02:00
Aaron Piotrowski
a1a83bf5f0 Switch code on thrown TypeError and ParseError to 0, update related tests 2015-07-07 16:54:39 -05:00
Kalle Sommer Nielsen
ce2cd89258 Replace references to PHP_WIN32 and TSRM_WIN32 with ZEND_WIN32 in Zend/, this also fixes 1 instance of where fflush(stderr) was misplaced (zend_extensions.c) 2015-07-04 18:55:22 +02:00
Aaron Piotrowski
ed1b64877d Switch position of ce in exception ce variable names 2015-07-03 09:45:03 -05:00
Aaron Piotrowski
f9e9d3a437 Cleanup exception ce API
Removed recently added functions to get Error ce's and marked the old functions
fetching default_exception_ce and error_exception_ce as deprecated.
2015-07-03 09:44:30 -05:00
Aaron Piotrowski
110e0a5a2c Merge branch 'master' into throwable-interface
# Conflicts:
#	Zend/zend_language_scanner.c
#	Zend/zend_language_scanner.l
#	ext/simplexml/tests/SimpleXMLElement_xpath.phpt
2015-06-14 18:53:11 -05:00
Bob Weinand
21ccdf6304 Rebuild scanner, add NEWS/UPGRADING 2015-05-25 19:00:08 +02:00
Aaron Piotrowski
d042d08807 Remodel exceptions based on Throwable interface
Added Throwable interface that exceptions must
implement in order to be thrown. BaseException
was removed, EngineException renamed to
Error, and TypeException and ParseException
renamed to TypeError and ParseError. Exception
and Error no longer extend a common base
class, rather they both implement the Throwable
interface.
2015-05-16 15:30:59 -05:00
Bob Weinand
a9a6799964 Add line_start/end info to main op_array 2015-04-25 19:10:58 +02:00
Nikita Popov
d2607a0110 Move more stuff to file_context
Introduce helper macro FC(x) for CG(file_context).x.

end_compilation() now handled by file_context_end().

While at it, dropped zval wrapper for ticcks.
2015-04-21 17:39:07 +02:00
Nikita Popov
0381c1b79e Fixed bug #69388
Renamed compiler_context to oparray_context. Introduced per-file
file_context. Moved import tables into the file_context.

context_stack no longer exists, instead keeping backups of contexts
on C stack. Same for file contexts.

TODO: Move more things out of CG into file_context. There should be
a number of other things that we should not try to reuse in nested
compilations.
2015-04-20 18:18:52 +02:00
Bob Weinand
f3e124d58d Merge branch 'coroutineDelegation' of https://github.com/bwoebi/php-src 2015-04-14 17:58:58 +02:00
Nikita Popov
a8bf1c5d8f Throw ParseException from lexer
Primarily to avoid getting fatal errors from token_get_all().

Implemented using a magic E_ERROR token, which the lexer emits to
force a parser failure.
2015-04-02 16:31:17 +02:00
Dmitry Stogov
acfc31c0f8 Use zend_error_noreturn() for fatal errors 2015-04-01 13:32:23 +03:00
Dmitry Stogov
d146d15003 Optimize zend_string_realloc() add more specialized versions zend_string_extend() and zend_string_truncate() 2015-03-20 02:02:42 +03:00
Nikita Popov
f1a6c06f14 Support ParseException for require etc 2015-03-17 21:35:42 +01:00
Bob Weinand
b4a142ab97 Added yield from operator 2015-03-07 00:28:12 +01:00
Dmitry Stogov
2fa8d67a5c Use zend_string* instead of char* for opened_patch handling. Avoid reallocations and improve string reuse. 2015-03-04 02:05:28 +03:00
Andrea Faulds
797dee59cd Blast off to space. 2015-01-29 17:56:09 +00:00
Dmitry Stogov
b494aa0ba0 Fixed compiler reenterability 2015-01-22 20:39:34 +03:00
Sara Golemon
1010b0ea4f Provide compiler hook for altering the AST pre-compilation. 2015-01-19 10:43:57 -08:00
Xinchen Hui
218d83d217 Fixed annoying incompatible pointer type warning 2015-01-18 07:24:57 -05:00
Andrea Faulds
5f29b98051 Error on invalid octal (fixes PHPSadness #31)
Further error checks
2015-01-17 18:50:28 +00:00
Xinchen Hui
fc33f52d8c bump year 2015-01-15 23:27:30 +08:00
Stanislav Malyshev
b7a7b1a624 trailing whitespace removal 2015-01-10 15:07:38 -08:00
Anatol Belski
68dd8e8bd7 fix invalid free mentioned in bug 68665
thanks honey at internot dot info
2014-12-28 16:36:07 +01:00
Anatol Belski
6b59b276fd C89 compat 2014-12-19 07:17:30 +01:00
Andrea Faulds
bae46f307c Unicode Codepoint Escape Syntax 2014-12-19 00:40:59 +00:00
Anatol Belski
bdeb220f48 first shot remove TSRMLS_* things 2014-12-13 23:06:14 +01:00
Anatol Belski
d9d16d2e68 fix datatype mismatch warnings 2014-10-29 15:29:59 +01:00
Nikita Popov
e756333bbb Remove <% and <script language="php"> tags
As per https://wiki.php.net/rfc/remove_alternative_php_tags.

Removes:
 * <% opening tag
 * %> closing tag
 * <%= short opening tag
 * /<script\s+language\s*=\s*(php|"php"|'php')\s*>/i opening tag
 * /</script>/i closing tag
 * asp_tags ini directive
2014-10-05 21:57:05 +02:00
Nikita Popov
69e7c9d89c Initial coalesce operator implementation 2014-09-16 19:14:46 +01:00
Nikita Popov
e2d4d700cf Fix yy_limit computation after encoding switch
The three assignments above this line are still broken - they assume
that byte offsets in one encoding directly map to byte offsets in
another encoding.

I'm fixing the length here because it is the one causing out-of-bounds
reads and is easy to fix. For the others we'd have to actually compute
new offsets.
2014-09-11 14:52:59 +02:00
Nikita Popov
f017843df3 Remove self-contradictory zend multibyte assertion
Code that explicitly exists to handle an incompatible internal
encoding should not assert that the internal encoding is compatible.
2014-09-11 14:52:59 +02:00
Xinchen Hui
b625661248 Remove unnecessary branch/temp variable 2014-09-09 11:52:25 +08:00
Nikita Popov
af84d5737c Fix parser stack destruction with dummy ENCAPSED_AND_WHITESPACE
T_ENCAPSED_AND_WHITESPACE is now specified to always hold a value,
so give it a NULL value in the dummy cases.
2014-09-08 13:57:28 +02:00
Dmitry Stogov
b1f53ca415 Use efree_size() instead of efree() where posible 2014-08-27 20:49:56 +04:00
Nikita Popov
f8abb9a462 Handle remaining magic constants in parser as well
As far as I can see the !filename case cannot occur, so I dropped
it.
2014-08-26 23:36:52 +02:00
Nikita Popov
b7876e734a eval() with parse error uses clean shutdown now 2014-08-26 22:31:58 +02:00
Nikita Popov
59848e3fbb Remove ZEND_ACC_INTERACTIVE and CG(interactive)
As far as I can discern these are leftovers of the interactive
shell implementation that was used before PHP 5.4. Now the readline
ext makes use of normal eval calls for this.

So, dropping these until there is evidence to the contrary, as they
currently wouldn't work anyway.
2014-08-25 23:46:43 +02:00
Nikita Popov
d2a3bf9daf Fix compiler warnings 2014-08-25 23:08:01 +02:00
Nikita Popov
899a1ed59a Merge branch 'ast'
Conflicts:
	Zend/zend_compile.c
2014-08-25 22:04:33 +02:00
Nikita Popov
6db293d5e0 Merge remote-tracking branch 'php-src/master' into ast
Conflicts:
	Zend/zend_compile.c
	Zend/zend_compile.h
	Zend/zend_globals.h
	Zend/zend_language_parser.y
	Zend/zend_language_scanner.c
	Zend/zend_language_scanner.l
	Zend/zend_types.h
2014-08-25 21:52:18 +02:00
Anatol Belski
28b7a03318 master renamings phase 5 2014-08-25 21:20:44 +02:00
Anatol Belski
4d997f63d9 master renames phase 3 2014-08-25 20:22:49 +02:00
Anatol Belski
c3e3c98ec6 master renames phase 1 2014-08-25 19:24:55 +02:00