summaryrefslogtreecommitdiff
path: root/Zend/zend_compile.h
Commit message (Collapse)AuthorAgeFilesLines
* Fix "already in use" check inconsistencies/bugsNikita Popov2016-10-071-0/+7
| | | | | | | | | | | | | | | | | | | | | | | | | | This fixes the following issues: * "use function" and "use const" inside namespaced code were checking for conflicts against class imports. Now they always check against the correct symbol type. * Symbol conflicts are now always checked within a single file only. Previously class uses inside namespaced code were checked globally. This behavior is illegal because symbols from other files are not visible if opcache is used, resulting in behavioral discrepancies. Additionally this made the presence/absence of symbol errors dependent on autoloading order, which is volatile. * The "single file" restriction is now enforced by collecting defined symbols inside a separate hash table. Previously it was enforced (for the non-namespaced case) by comparing the filename of the symbol declaration. However this is inaccurate if the same filename is used multiple times, such as may happen if eval() is used. * Additionally the previous approach relies on symbols being registered at compile-time, which is not the case for late-bound classes, which makes the behavior dependent on class declaration order, as well as opcache (which may cause delayed early-binding). * Lastly, conflicts are now consistently checked for conditionally defined symbols. Previously only declaration-after-use conflicts were checked in this case. Now use-after-declaration conflicts are detected as well.
* Expose information about calls to "fake" closures (created through ↵Dmitry Stogov2016-09-261-0/+2
| | | | ReflectionFunction::getClosure), to allow extra specialization of RETRUN opcode handler.
* Merge branch 'PHP-7.0' into PHP-7.1Dmitry Stogov2016-08-291-0/+1
|\ | | | | | | | | * PHP-7.0: Fixed bug #72944 (Null pointer deref in zval_delref_p).
| * Fixed bug #72944 (Null pointer deref in zval_delref_p).Dmitry Stogov2016-08-291-0/+1
| |
* | Corrected typo in commentJoey2016-08-111-1/+1
| | | | | | | | Finger-key interface malfunction.
* | Forbid use of array() in nested destructuringNikita Popov2016-07-061-0/+4
| | | | | | | | Previously array() was only forbidden on the outermost level.
* | Fixed compilation warningsDmitry Stogov2016-06-211-1/+1
| |
* | Implemented RFC: Fix inconsistent behavior of $this variableDmitry Stogov2016-06-161-2/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Squashed commit of the following: commit bdd3b6895c3ce3eacfcf7d4bf4feb8dfa61801fd Author: Dmitry Stogov <dmitry@zend.com> Date: Thu Jun 16 00:19:42 2016 +0300 Fixed GOTO VM commit 2f1d7c8b89ce821086d357cf65f629f040a85c03 Author: Dmitry Stogov <dmitry@zend.com> Date: Wed Jun 15 21:01:57 2016 +0300 Removed unused variable commit cf749c42b0b1919f70b1e7d6dcbfff76899506af Author: Dmitry Stogov <dmitry@zend.com> Date: Wed Jun 15 19:06:16 2016 +0300 Protection from $this reassign through mb_parse_str() commit 59a9a6c83c66b666971e57f1173b33a422166efd Author: Dmitry Stogov <dmitry@zend.com> Date: Wed Jun 15 18:14:50 2016 +0300 Added type inference rule for FETCH_THIS opcode commit 73f8d14a856f14a461430b3c7534ab2ce870cbf6 Author: Dmitry Stogov <dmitry@zend.com> Date: Wed Jun 15 18:11:18 2016 +0300 Restored PHP-7 behavior of isset($this->foo). It throws exception if not in object context. Removed useless opcode handlers. commit fa0881381e8ae97e022ae5d1ec0851c952f33c82 Author: Dmitry Stogov <dmitry@zend.com> Date: Tue May 31 12:25:47 2016 +0300 Changed "Notice: Undefined variable: this" into "Exception: Using $this when not in object context". commit e32cc528c0f2c97963d8ec83eff0269f1f45af18 Author: Dmitry Stogov <dmitry@zend.com> Date: Tue May 24 02:02:43 2016 +0300 Throw exception on attempt to re-assign $this through extract() and parse_str(). commit 41f1531b52113ec8a4c208aa6b9ef50f1386bb3f Author: Dmitry Stogov <dmitry@zend.com> Date: Mon May 23 22:18:36 2016 +0300 Fixed inconsistent $this behavior
* | Split ZEND_SEND_VAR_NO_REF into ZEND_SEND_VAR_NO_REF and ↵Dmitry Stogov2016-05-311-5/+0
| | | | | | | | ZEND_SEND_VAR_NO_REF_EX (similar to ZEND_SEND_VAL) and remove ZEND_ARG_* flags.
* | Fixed bug #72213 (Finally leaks on nested exceptions).Dmitry Stogov2016-05-251-5/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Squashed commit of the following: commit 8461b0407fc9eab0869d43b84e6a92ba2fe06997 Author: Dmitry Stogov <dmitry@zend.com> Date: Wed May 25 00:34:42 2016 +0300 Rmoved zend_try_catch_element.parent and walk through op_array.try_catch_array backward from the current try_cacth_offset. commit 0c71e249649bed178bfbef30bb3e63c57f07af05 Author: Dmitry Stogov <dmitry@zend.com> Date: Wed May 25 00:04:53 2016 +0300 Move SAVE_OPLINE() to its original place commit 111432a4df738fcd65878a42f23194dc3c4983a2 Author: Dmitry Stogov <dmitry@zend.com> Date: Wed May 25 00:01:10 2016 +0300 Separate the common part of ZEND_HANDLE_EXCEPTION and FAST_RET into zend_dispatch_try_catch_finally_helper. commit 4f21c06c2ec17819a708bc037f318784554a6ecd Author: Nikita Popov <nikic@php.net> Date: Tue May 24 14:55:27 2016 +0200 Improve finally fix commit da5c7274997b8308e682b5bf280124e3a1483086 Author: Dmitry Stogov <dmitry@zend.com> Date: Tue May 24 10:36:08 2016 +0300 Fixed Zend/tests/try/bug70228_3.phpt and Zend/tests/try/bug70228_4.phpt commit cfcedf2fb4f4fc1f7de9f7d53a3037fed7795f19 Author: Dmitry Stogov <dmitry@zend.com> Date: Tue May 24 02:59:27 2016 +0300 Added test commit 4c6aa93d43da941eb4fda15b48154bfb104bdc04 Author: Dmitry Stogov <dmitry@zend.com> Date: Tue May 24 00:38:20 2016 +0300 Added tests commit 8a8f4704b0eca2e460d42c1f253a363b0db8e510 Author: Dmitry Stogov <dmitry@zend.com> Date: Mon May 23 23:27:34 2016 +0300 Fixed bug #72213 (Finally leaks on nested exceptions)
* | Forbid dynamic calls to scope introspection functionsNikita Popov2016-05-241-0/+1
| | | | | | | | | | Per RFC: https://wiki.php.net/rfc/forbid_dynamic_scope_introspection
* | Merge branch 'nullable_types' of github.com:morrisonlevi/php-srcDmitry Stogov2016-05-231-0/+2
|\ \ | | | | | | | | | | | | | | | | | | * 'nullable_types' of github.com:morrisonlevi/php-src: Fix bug #71428 Add nullable parameter types Implement nullable return types.
| * | Implement nullable return types.Dmitry Stogov2016-05-051-0/+2
| | |
* | | Check if generator object is created by GENERATOR_CREATE when throw ↵Dmitry Stogov2016-05-161-0/+1
| | | | | | | | | | | | exceptions from generator function
* | | Extend CAL_FLAGS from 8-bit to 16-bitDmitry Stogov2016-05-161-1/+1
| | |
* | | Eliminated checks for (func->op_array.fn_flags & ZEND_ACC_GENERATOR) in fast ↵Dmitry Stogov2016-05-131-3/+5
|/ / | | | | | | | | | | | | path of DO_FCALL* handlers. This slightly improves calls to regular function and method calls in cost of a bit slower generator initialization. Separate call frame for generators, allocated on heap, now created by ZEND_GENERATOR_CREATE instruction.
* | Merge branch 'PHP-7.0'Joe Watkins2016-05-041-0/+3
|\ \ | |/ | | | | | | * PHP-7.0: add compiler option to disable builtins (special case function calls)
| * add compiler option to disable builtins (special case function calls)Joe Watkins2016-05-041-0/+3
| |
* | Fixed breaks of strict-aliasing rulesDmitry Stogov2016-04-291-4/+5
| |
* | Don't initialize EX(call)->symbol_table on each function call.Dmitry Stogov2016-04-281-1/+1
| | | | | | | | Keep it uninitialized, and check ZEND_CALL_HAS_SYMBOL_TABLE flag when necessary.
* | Merge remote-tracking branch 'origin/PHP-7.0'Bob Weinand2016-04-211-0/+2
|\ \ | |/
| * allow null coalescing (??) on constant expressionsMárcio Almada2016-04-211-0/+2
| |
* | Use DO_FCALL_BY_NAME instead of DO_FCALL, if possibleDmitry Stogov2016-04-141-1/+1
| |
* | Merge zend_execute_data->called_scope into zend_execute_data->This.Dmitry Stogov2016-04-011-3/+2
| | | | | | | | | | | | | | "called_scope" made sense only for static method calls, for dynamic calls it was always equal to the class of $this. Now EG(This) may store IS_OBJECT + $this or IS_UNUSED + "called_scope" (of course, "called_scope" may be NULL). Some code might need to be adopted to support this change. Checks (Z_OBJ(EX(This))) might need to be converted into (Z_TYPE(EX(This)) == IS_OBJECT).
* | Use CALL_INFO flag to check if we need to destroy symbol_table.Dmitry Stogov2016-03-311-1/+1
| | | | | | | | This saves one memory load on most RETURN opcodes.
* | Warn about invalid strings in arithmeticAndrea Faulds2016-03-301-0/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Squashed commit of the following: commit e05d3b67325d4521418483ed924ac9211a188919 Author: Andrea Faulds <ajf@ajf.me> Date: Wed Mar 30 01:43:35 2016 +0100 UPGRADING and NEWS commit 6caf1d4585207d1b02fb06a216cd7da1a1f5e12d Author: Andrea Faulds <ajf@ajf.me> Date: Sun Mar 20 21:18:33 2016 +0000 Fixes commit 6dadb1b0efe5e2ed071e95a55c806519e61377ac Author: Andrea Faulds <ajf@ajf.me> Date: Sun Feb 14 02:15:01 2016 +0000 Add test for numeric string errors in assignment commit bd5f04e8dd576f92a48d25546f4f9a0f57f374de Author: Andrea Faulds <ajf@ajf.me> Date: Sat Feb 13 23:53:05 2016 +0000 Add test for numeric string errors commit c72e92f16d512bcae30cc9639c89bcb08d971742 Author: Andrea Faulds <ajf@ajf.me> Date: Tue Jan 26 23:28:33 2016 +0000 Add test for scientific notation in integer operations commit d94c08852d405b3a7ef6c84d24bf7915c890ce78 Author: Andrea Faulds <ajf@ajf.me> Date: Sun Feb 14 01:25:57 2016 +0000 Disable optimiser evaluation for numeric string errors commit 30ee954ed13d933e766c68605d683c8ebae3d8ee Author: Andrea Faulds <ajf@ajf.me> Date: Sun Feb 14 01:46:25 2016 +0000 fixup commit a6403b79e054c95e2b7345d787f3092b261eed27 Author: Andrea Faulds <ajf@ajf.me> Date: Sat Feb 13 22:00:27 2016 +0000 Do not convert error-causing numeric strings ahead-of-time commit f9dc35401471ef3035954cb6f171826769297548 Author: Andrea Faulds <ajf@ajf.me> Date: Sat Feb 13 19:15:38 2016 +0000 Disable compile-time evaluation for numeric string errors commit e05b0cc8496ea082c6db27efd8b8277ef1f785b5 Author: Andrea Faulds <ajf@ajf.me> Date: Fri Feb 5 11:42:26 2016 +0000 Make _zval_get_long_func_noisy function for inlining commit 84d66321a57e579759109650c8bb7e3d5002854a Author: Andrea Faulds <ajf@ajf.me> Date: Tue Jan 26 23:10:00 2016 +0000 Update tests commit 5ac4a0cc4bff282e3a15eaa8ab44b67391881a6d Author: Andrea Faulds <ajf@ajf.me> Date: Tue Jan 26 22:08:19 2016 +0000 Use is_numeric_string_ex for zval_get_long etc. commit c21f08848533723331012a62a153de3577731d6a Author: Andrea Faulds <ajf@ajf.me> Date: Thu Jan 7 21:13:04 2016 +0000 Update tests commit 63e214cf8160420bfc51c6a2b4ae32f09ad8e8af Author: Andrea Faulds <ajf@ajf.me> Date: Wed Jan 6 00:28:01 2016 +0000 Warn on non-/bad numeric strings in arithmetic
* | Remove some dead definesNikita Popov2016-03-261-2/+0
| |
* | Drop some dead definesNikita Popov2016-03-201-15/+0
| |
* | Remove ZEND_CALL_CTOR_RESULT_UNUSEDNikita Popov2016-02-111-1/+1
| | | | | | | | Instead emit a FREE on the result of NEW.
* | Remove EXT_TYPE_UNUSED in favor of IS_UNUSEDNikita Popov2016-02-111-2/+0
| | | | | | | | | | | | | | | | | | | | | | This means we no longer allocate an unused VAR for the retval of instructions that support unused results. Nearly all instructions already used the result variable only if it was used. The only exception to this was the return value variable for internal function call results. I've adjusted the code to use a stack zval for the unused return case now. As we have retval specialization now, we know that it doesn't matter.
* | Introduced BIND_STATIC opcode instead of ↵Dmitry Stogov2016-01-121-1/+0
| | | | | | | | | | | | FETCH_R/FETCH_W(static)+ASSIGN/ASSIGN_REF (similar to BIND_GLOBAL). In the future we may refer to static variable by index instead of name, to eliminate hash lookup.
* | Merge branch 'PHP-7.0'Xinchen Hui2016-01-021-1/+1
|\ \ | |/
| * bump year which is missed in rev 49493a2Xinchen Hui2016-01-021-1/+1
| |
* | Introduce BIND_LEXICALNikita Popov2015-12-291-1/+0
| | | | | | | | | | | | | | | | | | | | | | This opcodes inserts a local CV into the closure static variable table. This replaces the previous mechanism of having static variables marked as LEXICAL, which perform a symtable lookup during copying. This means a) functions which contain closures no longer have to rebuild their symtable (better performance) and b) we can now track used variables in SSA.
* | Merge branch 'PHP-7.0'Julien Pauli2015-12-241-3/+3
|\ \ | |/ | | | | | | * PHP-7.0: Remove mentions of "type hint" and "typehint"
| * Remove mentions of "type hint" and "typehint"Levi Morrison2015-12-241-3/+3
| |
* | Remove BP_VAR_REFNikita Popov2015-12-111-1/+0
| | | | | | | | | | The distinction between BP_VAR_REF and BP_VAR_W is no longer revelant, since we dropped support for =& new.
* | Remove FETCH_STATIC_MEMBER flagNikita Popov2015-12-101-1/+0
| |
* | Implemented the RFC `Support Class Constant Visibility`.Dmitry Stogov2015-12-081-0/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Squashed commit of the following: commit f11ca0e7a57793fa0e3e7f6d451720e6c42bb0b9 Author: Dmitry Stogov <dmitry@zend.com> Date: Tue Dec 8 12:38:42 2015 +0300 Fixed test expectation commit 211f873f542504d0a0f72b6b5cb23908a1c99a2d Author: Dmitry Stogov <dmitry@zend.com> Date: Tue Dec 8 12:28:38 2015 +0300 Embed zend_class_constant.flags into zend_class_constants.value.u2.access_flags commit 51deab84b2cdbf9cdb1a838cf33b2ee45c61748b Author: Dmitry Stogov <dmitry@zend.com> Date: Mon Dec 7 11:18:55 2015 +0300 Fixed issues found by Nikita commit 544dbd5b47e40d38a8ccb96bc5583e9cb7fdd723 Author: Dmitry Stogov <dmitry@zend.com> Date: Sat Dec 5 02:41:05 2015 +0300 Refactored immplementation of https://wiki.php.net/rfc/class_const_visibility @reeze created an RFC here and I emailed internals here and didn't get any responses positive/negative.
* | Fixed signed/unsigned mismatchDmitry Stogov2015-11-171-1/+1
| |
* | Don't undo/redo "pass two" for jump targets in opcache optimizer.Dmitry Stogov2015-11-171-0/+11
| |
* | Squashed commit of the following:Dmitry Stogov2015-11-131-0/+7
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | commit afe963e6cc289696e60c6c679796ba2197c52b3b Author: Dmitry Stogov <dmitry@zend.com> Date: Fri Nov 13 15:32:29 2015 +0300 Added news entry commit a126b891c97848dd7ef8f1abf716328c46e0f19c Author: Dmitry Stogov <dmitry@zend.com> Date: Fri Nov 13 15:29:21 2015 +0300 VERIFY_RETURN_TYPE doesn't have to cleanup operand on exception, bacause now, live temporary variables are released by exception unwinder. commit 0db475e98786e6bcaa8401ee3e0b33743b9a2f2b Author: Dmitry Stogov <dmitry@zend.com> Date: Thu Nov 12 22:55:39 2015 +0300 Fixed copy/paste commit 0ac73fe7174bec9de9a610319a98b259bea67f7f Author: Dmitry Stogov <dmitry@zend.com> Date: Wed Nov 11 16:11:50 2015 +0300 Fixed bug #62210 (Exceptions can leak temporary variables)
* | Separate common part of compile_file() and compile_string() into zend_compile()Dmitry Stogov2015-11-121-1/+1
| |
* | We don't nees zend_op_array->brk_cont_array at run-time anymore.Dmitry Stogov2015-11-101-15/+22
|/ | | | | | Move zend_op_array->brk_cont_array into CG(context).brk_cont_array. Use more compact zend_op_array->live_range instead of zend_op_array->brk_cont_array. Semantic is kept unchanged.
* Fix bug #70650Márcio Almada2015-10-071-1/+0
|
* Revert "Fixed bug #70630 (Closure::call/bind() crash with ↵Dmitry Stogov2015-10-061-1/+1
| | | | | | ReflectionFunction->getClosure())" This reverts commit 517b5536259ecf7697f353f4bfbafde857fc1f81.
* Revert "Speed up self::method() calls (no ZEND_FETCH_CLASS)"Dmitry Stogov2015-10-061-8/+7
| | | | This reverts commit 8c33bdb976e957ea67ebffd424e0a133a79c6ebe.
* Speed up self::method() calls (no ZEND_FETCH_CLASS)Bob Weinand2015-10-051-7/+8
|
* Fixed bug #70630 (Closure::call/bind() crash with ↵Bob Weinand2015-10-041-1/+1
| | | | | | | ReflectionFunction->getClosure()) This additionally removes support for binding to an unknown (not in parent hierarchy) scope. Removing support for cross-scope is necessary for certain compile-time assumptions (like class constants) to prevent unexpected results
* Reordered field to improve data lacality and reduce L1D CPU cache misses in ↵Dmitry Stogov2015-09-301-7/+7
| | | | ZEND_INIT_FCALL opcode family