Commit Graph

73 Commits

Author SHA1 Message Date
Nikita Popov
4892bbc167 Fixed bug #78230 2019-07-03 10:20:07 +02:00
Nikita Popov
61a38bb274 SCCP: Fix leak when determining TYPE_CHECK from type info
As TYPE_CHECK is the only opcode where we do something like this,
I'm adding this hack.
2019-05-29 16:47:19 +02:00
Nikita Popov
97ba6b0d8b Don't evaluate functions with partial array arguments 2019-05-21 17:35:03 +02:00
Nikita Popov
30f1b17262 Fix null check in sccp add_array_elem chain handling
We need to check result_use rather than result_def for a null zval.
Previously we were later assuming that the null zval is really a
partial array, which does not go well.
2019-05-21 17:15:07 +02:00
Nikita Popov
fc4836b193 Fix partial array handling in FE_RESET edge feasibility 2019-05-21 16:59:27 +02:00
Nikita Popov
cd188d0398 Handle partial arrays in zend_is_true() checks 2019-05-21 16:53:34 +02:00
Nikita Popov
bdce5849b7 Extract ct_eval_binary_op()
And use it in more places, though some of them are currently not
reachable by partial arrays to the best of my knowledge.
2019-05-21 16:43:41 +02:00
Nikita Popov
367788cbc3 Improve SCCP debug code
In particular properly dump partial arrays when tracing execution.
2019-05-21 16:42:13 +02:00
Nikita Popov
9d76fbd0c4 Fixed bug #78015
Don't try to evaluate various operations with partial array operands.
We could evaluate some of these, but let's be conservative for now...
2019-05-15 14:35:31 +02:00
Joe Watkins
e1c93d1fb2
Merge branch 'PHP-7.2' into PHP-7.3
* PHP-7.2:
  Properly check for array_replace_recursive in sccp.c
2019-02-03 08:41:26 +01:00
Tyson Andre
cf56832d00
Properly check for array_replace_recursive in sccp.c
Due to a typo, this code used to check for array_merge_recursive
twice.
2019-02-03 08:40:21 +01:00
Nikita Popov
ade702a0d2 Fixed bug #77434
Mark arrays containing partial arrays as partial. This was already
done for the ADD_ARRAY_ELEMENT case, but not for ASSIGN_DIM.
2019-01-10 10:25:55 +01:00
Nikita Popov
6f75890e7b Fix one issue reported in bug #77310
SCCP did not handle array ASSIGN_* with a BOT operand correctly.
2019-01-07 10:05:23 +01:00
Nikita Popov
d92f7630f7 Merge branch 'PHP-7.2' into PHP-7.3 2018-11-02 14:30:50 +01:00
Nikita Popov
4daa413898 Fixed bug #77092
Weird that this worked for so long, probably because nearly all
ext/standard functions use fast ZPP rather than ordinary ZPP.
2018-11-02 14:29:03 +01:00
Zeev Suraski
9afce019e0 Future-proof email addresses 2018-11-01 18:35:32 +02:00
Peter Kokot
902d39a3a7 Trim trailing whitespace in source code files 2018-10-13 14:14:50 +02:00
Nikita Popov
a32c563e50 Merge branch 'PHP-7.2' into PHP-7.3 2018-09-07 14:02:51 +02:00
Nikita Popov
cfdd828163 Fixed bug #76796 2018-09-07 14:02:03 +02:00
Dmitry Stogov
84d7d4e1cc Fixed bug #76466 (Loop variable confusion) 2018-06-18 11:21:23 +03:00
Dmitry Stogov
9e0f131d2b Fixed ISSET/ISEMPTY bit meaning to simplify run-time checks 2018-05-31 19:02:51 +03:00
Dmitry Stogov
5eb1f92f31 Use zend_string_release_ex() instread of zend_string_release() in places, where we sure about string persistence. 2018-05-28 16:27:12 +03:00
Dmitry Stogov
c88be6aee1 Bit check micro-optimization 2018-04-28 14:13:12 +03:00
Nikita Popov
9a3bb1201f Merge branch 'PHP-7.2' 2018-03-24 13:16:31 +01:00
Nikita Popov
3306577797 Followup fix for bug #75729
The case of overloaded substr() with 3 arguments was not handled.
2018-03-24 13:15:59 +01:00
Nikita Popov
aa7dbc8ee7 Merge branch 'PHP-7.2' 2018-02-05 21:10:12 +01:00
Nikita Popov
d9e71169e6 Fixed bug #75729
Don't try to evaluate substr() and strpos() at compile-time if
mbstring function overloading is enabled. I'm reusing the
COMPILE_NO_BUILTIN_STRLEN for the detection of mbstring function
overloading here, even if it's technically only about strlen()...
2018-02-05 21:08:18 +01:00
Dmitry Stogov
ca035f26aa Moved "zval.u2.cache_slot" into free room of "zend_op" 2018-02-05 19:41:47 +03:00
Dmitry Stogov
3a794d39f0 Avoid repeatable ARG_SHOULD_BE_SENT_BY_REF() checks in FETCH_*FUNC_ARG and following SEND_VAR_EX. Perform the check once in a new CHECK_FUNC_ARG opcode and reuse in the following FETCH_*FUNC_ARG and SEND_FUNC_ARG (SEND_VAR_EX replacement). 2018-02-05 19:40:06 +03:00
Dmitry Stogov
f67f455ef7 Changed FETCH_CLASS instruction format (extended_value moved into op1) 2018-01-31 18:14:43 +03:00
Dmitry Stogov
7141631cc8 Change FETCH/ISSET instruction modifiers:
- Get rid of ZEND_ISEMPTY and ZEND_ISSET_ISEMPTY_MASK. Use just single ZEND_ISSET bit to make distinct between isset() and empty()
- Use ZEND_FETCH_GLOBAL, ZEND_FETCH_LOCAL and ZEND_FETCH_GLOBAL_LOCK as bitmask
- Removed unused ZEND_FETCH_STANDARD
- Extended ZEND_FETCH_ARG_MASK
2018-01-30 22:06:05 +03:00
Dmitry Stogov
bf7176c70f Use reference-counting instead of duplication and separation, if really necessary. 2018-01-19 01:03:24 +03:00
Xinchen Hui
63a96ebf6a Fixed bug while dealing with ADD_ARRAY_ELEMENT against an existing const array 2018-01-07 14:17:47 +08:00
Xinchen Hui
8d63c834e4 Change assertion 2018-01-05 15:05:05 +08:00
Xinchen Hui
729a6688af Optimized FETCH_CLASS before INSTANCEOF out if possible 2018-01-05 12:58:28 +08:00
Xinchen Hui
1db6c19365 Fixed wrongly const replacing on partial array 2018-01-05 12:29:39 +08:00
Xinchen Hui
76d0e3d514 Enable replacing const to INSTANCEOF 2018-01-03 18:28:03 +08:00
Xinchen Hui
a6519d0514 year++ 2018-01-02 12:57:58 +08:00
Xinchen Hui
7a7ec01a49 year++ 2018-01-02 12:55:14 +08:00
Dmitry Stogov
f010423335 Use IS_EQUAL instead of CASE when first operand is CV or CONST. Removed CASE handlers that duplicated IS_EQUAL. 2017-12-29 12:57:58 +03:00
David Walker
6d4de4cf05 Implement list() reference assignments
Support list() reference assignments of the form:

    list(&$a, list(&$b, $c)) = $d;

RFC: https://wiki.php.net/rfc/list_reference_assignment
2017-12-09 13:39:52 +01:00
Xinchen Hui
3475197551 Merge branch 'PHP-7.2'
* PHP-7.2:
  Improved fix
2017-11-27 12:03:48 +08:00
Xinchen Hui
9d02227243 Improved fix 2017-11-27 12:03:37 +08:00
Dmitry Stogov
33b094479b TYPE_CHECK instruction changed. Now it keeps in extended_value a type mask.
This makes check for "boolean" cheaper and allows check combination e.g. (is_string($a) || is_null($a))
2017-11-23 15:58:34 +03:00
Xinchen Hui
f87a0b32c6 Merge branch 'PHP-7.2'
* PHP-7.2:
  Fixed bug #75370 (Webserver hangs on valid PHP text)
  Fixed typo
2017-10-13 18:19:19 +08:00
Xinchen Hui
e4f7ff9c0f Fixed bug #75370 (Webserver hangs on valid PHP text) 2017-10-13 18:18:10 +08:00
Dmitry Stogov
e7afdb0668 Fixed invalid type 2017-10-04 16:06:57 +03:00
Dmitry Stogov
44e0b79ac6 Refactored array creation API. array_init() and array_init_size() are converted into macros calling zend_new_array(). They are not functions anymore and don't return any values. 2017-09-20 02:25:56 +03:00
Dmitry Stogov
12550b2c39 Removed IS_TYPE_COPYABLE flag. 2017-09-15 12:29:46 +03:00
Dmitry Stogov
b7d683c531 Added debug output 2017-09-13 23:59:16 +03:00