1
0
mirror of https://github.com/php/php-src.git synced 2026-04-22 23:48:14 +02:00
Commit Graph

13565 Commits

Author SHA1 Message Date
Xinchen Hui ffaee27478 Fixed bug #76427 (Segfault in zend_objects_store_put) 2018-06-11 21:00:38 +08:00
Tyson Andre d0fc6dba0c Fix the Z_IMMUTABLE macro - '(' was mismatched
The macro properly has two matching `(` and `)` symbols
after this change.

This typo was causing syntax errors when compiling extensions
using the (deprecated) macro.

This fixes a bug in the PHP 7.3 branch introduced by
742d5a01ed
2018-06-10 21:21:42 +02:00
Nikita Popov 95a0709935 Fix handling of ERROR zval in op1 of ASSIGN_REF
If op1 is ERROR the behavior is to not perform any assignment and
return NULL. However, if the RHS was a by-value returning function,
we'd instead emit a notice and return the RHS as the return value
(even though the value was not assigned to anything -- the temporary
is immediately destroyed).

This normalized the behavior to always check for an ERROR in op1
first.
2018-06-09 21:31:30 +02:00
Nikita Popov d877d18676 Error on by-ref assign to overloaded prop returning ref
This error was already thrown if __get() was used -- however not
if it returned by reference. This is incorrect, because the
reference return makes no difference to a by-reference assignment,
which has reference-breaking semantics. The result was that the
assignment was accepted silently, even though it didn't do anything
(not even the value was assigned, let alone the reference).
2018-06-09 18:42:22 +02:00
Nikita Popov 7498f0163b Fix handling of assign-ops on overloaded props with ref return
Assign-ops and incdec on overloaded properties are implemented
using a read_property followed by write_property. Previously, if
__get() returned by-reference, pre-incdec and assign-op
additionally also modified the reference, while post-incdec worked
correctly.

This change synchronizes the three code-paths to not modify the
reference. The pre-incdec implementation matches the post-incdec
implementation, the assign-op implementation uses a distinct
result operand.
2018-06-09 00:36:46 +02:00
Dmitry Stogov 1597b56619 Inline few small opcode handlers into hybrid executor 2018-06-07 16:30:53 +03:00
Dmitry Stogov 180bf90ded Fastcall calling convention is not comaptible with variable number of arguments 2018-06-06 15:27:18 +03:00
Dmitry Stogov 531de5f24a Fixed prototypes, foo(void) instead of foo() 2018-06-06 15:26:26 +03:00
Dmitry Stogov 18bc3afdcb Micro-optimizations 2018-06-06 01:57:19 +03:00
Dmitry Stogov 59c2ff2543 Embed zend_leave_helper() into hybrid executor to avoid call overhead. 2018-06-05 11:33:19 +03:00
Dmitry Stogov b6a2ae3a5b Cleanup 2018-06-05 11:26:15 +03:00
Nikita Popov adb09c98d2 Fix return type of zend_ini_dtor 2018-06-02 13:41:09 +02:00
Dmitry Stogov 0b90cf85a6 Removed "dead" code (zend_hash_update() never fails) 2018-06-01 11:58:57 +03:00
Dmitry Stogov 9e0f131d2b Fixed ISSET/ISEMPTY bit meaning to simplify run-time checks 2018-05-31 19:02:51 +03:00
Anatol Belski 35302c22ac Use hrtime() for timing tests 2018-05-31 15:32:47 +02:00
Dmitry Stogov f2b4ec4bdc Export standard object handlers, to avoid indirect access 2018-05-31 11:57:22 +03:00
Dmitry Stogov 0d72bb8fcb Optimize zend_new_array() for special case, when size <= HT_MIN_SIZE 2018-05-31 01:17:55 +03:00
Dmitry Stogov 683123fa39 Use SSE2 instruction to reset HashTable 2018-05-30 20:17:52 +03:00
Dmitry Stogov 655d249ac9 Eliminate some checks for zero character inside an inclue file name 2018-05-30 18:24:31 +03:00
Dmitry Stogov ff58d70548 Avoid agressive inlining in rarely used paths 2018-05-30 14:03:48 +03:00
Dmitry Stogov 84aab1d4e1 Marked rarely used opcodes as "cold" (e.g. ADD_CONST_CONST ususaly optimized out). 2018-05-30 01:50:44 +03:00
Dmitry Stogov da5a44c1c0 Revert "Avoid reference-counting"
This reverts commit ea26ab3393.
2018-05-29 18:04:16 +03:00
Dmitry Stogov d90c6f2443 Removed useless zval_ptr_dtor() 2018-05-29 17:58:06 +03:00
Dmitry Stogov 37069d7d2f Replace unused generic zend_hash_*add_or_update() functions by compact implmentations. 2018-05-29 01:38:27 +03:00
Dmitry Stogov f4b7239cae _zend_hash_index_add_or_update_i() optimization 2018-05-29 00:09:49 +03:00
Anatol Belski 6f4a01da21 Fix build without global registers 2018-05-28 20:44:58 +02:00
Dmitry Stogov 9af07b6ed5 Merge branch 'master' of git.php.net:php-src
* 'master' of git.php.net:php-src:
  Translate correct C++ version with suitable compiler
  Fixed bug #76383 (array_map on $GLOBALS returns IS_INDIRECT)
2018-05-28 18:30:04 +03:00
Dmitry Stogov c27dda709c Removed dead code 2018-05-28 18:29:43 +03:00
Anatol Belski 74be58938c Merge branch 'PHP-7.2'
* PHP-7.2:
  Translate correct C++ version with suitable compiler
  Fixed bug #76383 (array_map on $GLOBALS returns IS_INDIRECT)
2018-05-28 17:15:22 +02:00
Anatol Belski d5ee654b71 Merge branch 'PHP-7.1' into PHP-7.2
* PHP-7.1:
  Translate correct C++ version with suitable compiler
  Fixed bug #76383 (array_map on $GLOBALS returns IS_INDIRECT)
2018-05-28 17:13:55 +02:00
Dmitry Stogov c9df8ac6c5 Separate common code into helper function 2018-05-28 18:11:43 +03:00
Dmitry Stogov ea26ab3393 Avoid reference-counting 2018-05-28 17:10:58 +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 925f05dd1a Added missing debug arguments 2018-05-28 13:09:33 +03:00
Bob Weinand 97a8483143 Fixed bug #76383 (array_map on $GLOBALS returns IS_INDIRECT) 2018-05-28 00:48:35 +02:00
Xinchen Hui 6c3a38353c indent 2018-05-22 17:05:39 +08:00
Xinchen Hui bc1211b8b8 unnecessary branch 2018-05-22 17:04:42 +08:00
Anatol Belski bcb1dbf6e4 Merge branch 'PHP-7.2'
* PHP-7.2:
  Fixed bug #76337
2018-05-20 13:33:46 +02:00
xKhorasan 5681f6523b Fixed bug #76337 2018-05-20 13:33:03 +02:00
Anatol Belski 8ebb6e1d9d Extend compile conditions 2018-05-15 11:57:32 +02:00
Dmitry Stogov e9e2d068b6 Fixed conditions 2018-05-14 17:23:37 +03:00
Dmitry Stogov 524f5245c5 Avoid useless checks, using zend_string_efree(), in cases where the string is known to be a temporary allocated zend_string. 2018-05-08 17:30:15 +03:00
Dmitry Stogov 9565075cbd Destroy function arguments in direct order 2018-05-08 15:28:57 +03:00
Xinchen Hui a48ade17db Cleanup 2018-05-08 17:32:35 +08:00
Dmitry Stogov 4ad9cf4605 Bit test optimization 2018-05-08 11:58:17 +03:00
Dmitry Stogov b8a91ac50b Use "fastcall" calling convention 2018-05-08 01:31:49 +03:00
Dmitry Stogov 1e00b767a4 Use iteration instead of recursion 2018-05-08 01:22:39 +03:00
Dmitry Stogov 858d545ce6 micro optimization 2018-05-08 00:22:04 +03:00
Dmitry Stogov 63f5e11d9b Use add/sub instead of inc/dec 2018-05-08 00:00:59 +03:00
Dmitry Stogov 880694952f micro optimisation 2018-05-07 22:29:16 +03:00