summaryrefslogtreecommitdiff
path: root/Zend/zend_vm_def.h
Commit message (Collapse)AuthorAgeFilesLines
...
* | | Fix passing of undef var to named argNikita Popov2020-08-261-1/+0
| | | | | | | | | | | | This needs to use the previously computed argument target.
* | | Fix memory leak on unknown named paramNikita Popov2020-08-261-0/+8
| | |
* | | Merge branch 'PHP-7.4'Nikita Popov2020-08-261-0/+1
|\ \ \ | |/ / | | | | | | | | | * PHP-7.4: Fix memory leak when yielding from non-iterable
| * | Merge branch 'PHP-7.3' into PHP-7.4Nikita Popov2020-08-261-0/+1
| |\ \ | | |/ | | | | | | | | | * PHP-7.3: Fix memory leak when yielding from non-iterable
| | * Fix memory leak when yielding from non-iterableNikita Popov2020-08-261-0/+1
| | |
* | | Merge branch 'PHP-7.4'Nikita Popov2020-08-241-0/+2
|\ \ \ | |/ / | | | | | | | | | * PHP-7.4: Fix refcounting
| * | Fix refcountingNikita Popov2020-08-241-0/+2
| | |
* | | Merge branch 'PHP-7.4' into masterChristoph M. Becker2020-08-241-2/+14
|\ \ \ | |/ / | | | | | | | | | * PHP-7.4: Fix #79979: passing value to by-ref param via CUFA crashes
| * | Fix #79979: passing value to by-ref param via CUFA crashesChristoph M. Becker2020-08-241-2/+14
| | | | | | | | | | | | | | | | | | | | | If a by-val send is not allowed, we must not do so. Instead we wrap the value in a temporary reference. Closes GH-6000
* | | Fixed use-after-free introduced by aed1f785159e7c9e81da8f2e2e06df9a6ee0d809Dmitry Stogov2020-08-241-3/+7
| | |
* | | micro-optimizationDmitry Stogov2020-08-201-14/+22
| | |
* | | Fix nullsafe operator on referenceNikita Popov2020-08-111-0/+3
| | | | | | | | | | | | | | | | | | Dereference the value before checking the type. As the happy path necessarily has to check for references, I'm not bothering to delay the comparison.
* | | Merge branch 'PHP-7.4'Nikita Popov2020-08-101-0/+1
|\ \ \ | |/ / | | | | | | | | | * PHP-7.4: Fixed bug #79947
| * | Fixed bug #79947Nikita Popov2020-08-101-0/+1
| | | | | | | | | | | | | | | | | | Move the FREE_OP for op_data out of the zend_binary_assign_op_dim_slow() slow path, so it can be used by the other error path as well. This makes ASSIGN_DIM_OP structurally more similar to ASSIGN_DIM.
* | | Implement named parametersNikita Popov2020-07-311-77/+359
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | From an engine perspective, named parameters mainly add three concepts: * The SEND_* opcodes now accept a CONST op2, which is the argument name. For now, it is looked up by linear scan and runtime cached. * This may leave UNDEF arguments on the stack. To avoid having to deal with them in other places, a CHECK_UNDEF_ARGS opcode is used to either replace them with defaults, or error. * For variadic functions, EX(extra_named_params) are collected and need to be freed based on ZEND_CALL_HAS_EXTRA_NAMED_PARAMS. RFC: https://wiki.php.net/rfc/named_params Closes GH-5357.
* | | Make check in RECV_VARIADIC more preciseNikita Popov2020-07-311-4/+6
| | | | | | | | | | | | | | | | | | Fetch arg_info only once (it's always the same one...) and check ZEND_TYPE_IS_SET on it, rather than checking if *any* parameter has a type.
* | | Implement nullsafe ?-> operatorIlija Tovilo2020-07-241-0/+33
| | | | | | | | | | | | | | | | | | | | | | | | RFC: https://wiki.php.net/rfc/nullsafe_operator Closes GH-5619. Co-authored-by: Nikita Popov <nikita.ppv@gmail.com>
* | | Fixed bug #79828Nikita Popov2020-07-131-1/+9
| | |
* | | Review the usage of apostrophes in error messagesMáté Kocsis2020-07-101-4/+4
| | | | | | | | | | | | Closes GH-5590
* | | Fixed bug #79818Nikita Popov2020-07-101-2/+3
| | | | | | | | | | | | | | | Only destroy the variable directly before reassigning it. The value could be read in the meantime.
* | | Implement match expressionIlija Tovilo2020-07-091-0/+66
| | | | | | | | | | | | | | | | | | RFC: https://wiki.php.net/rfc/match_expression_v2 Closes GH-5371.
* | | Remove FREE_UNFETCHED conceptNikita Popov2020-07-091-18/+18
| | | | | | | | | | | | | | | | | | In master normal FREE_OPs work like FREE_UNFETCHED_OP used to, so there is no point in keeping this distinction anymore, it's just confusing.
* | | Merge branch 'PHP-7.4'Nikita Popov2020-07-091-1/+1
|\ \ \ | |/ / | | | | | | | | | * PHP-7.4: Switch back to FREE_UNFETCHED_OP_DATA
| * | Switch back to FREE_UNFETCHED_OP_DATANikita Popov2020-07-091-1/+1
| | | | | | | | | | | | | | | Some of the code paths leading to this do not fetch op data. Hopefully this fixes the release build failure.
* | | Merge branch 'PHP-7.4'Nikita Popov2020-07-091-2/+1
|\ \ \ | |/ / | | | | | | | | | | | | * PHP-7.4: Fix bug #79599 in a different way Revert "Fixed bug #97599 (coredump in set_error_handler)"
| * | Fix bug #79599 in a different wayNikita Popov2020-07-091-4/+2
| | | | | | | | | | | | | | | Move the emission of the undefined variable notice before the array separation.
* | | Assert exception set in HANDLE_EXCEPTION()Nikita Popov2020-07-071-10/+0
| | | | | | | | | | | | | | | | | | Some code paths were checking this manually, but we can turn this into a general assertion to avoid surprises (functions returning failure without throwing).
* | | Fixed bug #79777Nikita Popov2020-07-041-1/+4
| | |
* | | Make exit() unwind properlyNikita Popov2020-06-291-5/+8
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | exit() is now internally implemented by throwing an exception, performing a normal stack unwind and a clean shutdown. This ensures that no persistent resource leaks occur. The exception is internal, cannot be caught and does not result in the execution of finally blocks. This may be relaxed in the future. Closes GH-5768.
* | | Change GC_COLLECTABLE flag into GC_NOT_COLLECTABLE to simplify GC_MAY_LEAK() ↵Dmitry Stogov2020-06-151-1/+1
| | | | | | | | | | | | check
* | | Support catching exceptions without capturing them to variablesMax Semenik2020-05-261-6/+6
| | | | | | | | | | | | | | | | | | RFC: https://wiki.php.net/rfc/non-capturing_catches Closes GH-5345.
* | | Merge branch 'PHP-7.4'Nikita Popov2020-05-261-10/+8
|\ \ \ | |/ / | | | | | | | | | * PHP-7.4: Respect typed references in catch assignment
| * | Respect typed references in catch assignmentNikita Popov2020-05-261-10/+8
| | | | | | | | | | | | | | | | | | | | | | | | I decided to null out EG(exception) early here, which means only the exception from the dtor / ref assign is preserved, and the previous exception is not chained in. This is more robust, and I don't think this situation is common enough to be bothered about the precise behavior.
* | | Clarify ZEND_CATCH codeNikita Popov2020-05-261-1/+1
| | | | | | | | | | | | UNDEF the opcode result instead of addref'ing the exception.
* | | Improve error messages for invalid property accessMáté Kocsis2020-05-181-1/+1
| | | | | | | | | | | | | | | Closes GH-5446 Co-authored-by: Nikita Popov <nikita.ppv@gmail.com>
* | | Use zend_zval_type_name() API where possibleNikita Popov2020-05-131-9/+8
| | | | | | | | | | | | Rather than zend_get_type_by_const(Z_TYPE_P()).
* | | Rename zend_zval_get_type() APINikita Popov2020-05-131-1/+1
| | | | | | | | | | | | | | | | | | We have a bunch of APIs for getting type names and it's sometimes hard to keep them apart ... make it clear that this is the one you definitely do not want to use.
* | | zend_timeout is not a signal handler functionAlex Dowad2020-05-121-1/+1
| | | | | | | | | | | | | | | The 'int dummy' parameter to this function makes it appear that it was intended as a signal handler, but it is not being used as such. So remove the redundant parameter.
* | | Speed up ZEND_SWITCH_STRING/ZEND_SWITCH_LONG for wrong typeTyson Andre2020-04-191-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This has the minor benefit of avoiding loading the address of the jump table when the expression for the switch isn't a string/long. gcc doesn't seem to optimize that. The previous function body is the original implementation: ad8652818a5 ``` // Before: 0.267s, after: 0.265s function test_switch($x) { for ($i = 0; $i < 10000000; $i++) { switch ($x) { case 'a': case 'b': echo "i=$i\n"; } } } test_switch(null); ``` Closes GH-5419
* | | Early return if variadic type check failsNikita Popov2020-04-171-1/+5
| | | | | | | | | | | | | | | | | | | | | Don't check all the remaining arguments after one check failed. I don't think this makes an observable behavior difference, because we already suppress duplicate exceptions in argument type error reporting.
* | | Merge branch 'PHP-7.4'Dmitry Stogov2020-04-171-1/+1
|\ \ \ | |/ / | | | | | | | | | * PHP-7.4: zend_timeout() may access EX(opline)
| * | Merge branch 'PHP-7.3' into PHP-7.4Dmitry Stogov2020-04-171-1/+1
| |\ \ | | |/ | | | | | | | | | * PHP-7.3: zend_timeout() may access EX(opline)
| | * zend_timeout() may access EX(opline)Dmitry Stogov2020-04-171-1/+1
| | |
* | | Improve undefined variable error messagesMáté Kocsis2020-03-311-2/+2
| | | | | | | | | | | | Closes GH-5312
* | | JIT for FETCH_THISDmitry Stogov2020-03-201-4/+0
| | |
* | | Improved JIT for BIND_GLOBALDmitry Stogov2020-03-181-13/+12
| | |
* | | Revert "Fetch for read in nested property assignments"Nikita Popov2020-03-181-22/+22
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This reverts commit bb43a3822e42dbd15b1d416a166549d3980b379a. After thinking about this a bit more, this is now going to be a complete solution for the "readonly properties" case, for example: unset($foo->readOnly->bar); should also be legal and $foo->readOnly['bar'] = 42; should also be legal if $foo->readOnly is not an array but an ArrayAccess object. I think it may be better to distinguish better on the BP_VAR flag level. Reverting for now.
* | | Fetch for read in nested property assignmentsNikita Popov2020-03-181-22/+22
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | $a->b->c = 'd'; is now compiled the same way as $b = $a->b; $b->c = 'd'; That is, we perform a read fetch on $a->b, rather than a write fetch. This is possible, because PHP 8 removed auto-vivification support for objects, so $a->b->c = 'd' may no longer modify $a->b proper (i.e. not counting interior mutability of the object). Closes GH-5250.
* | | Merge branch 'PHP-7.4'Dmitry Stogov2020-03-131-2/+11
|\ \ \ | |/ / | | | | | | | | | | | | | | | | | | * PHP-7.4: Check asserts early identation fix Call global code of preloaded script in global context Avoid "Anonymous class wasn't preloaded" error by lazely loading of not preloaded part of a preloaded script
| * | Check asserts earlyDmitry Stogov2020-03-121-1/+1
| | |