1
0
mirror of https://github.com/php/php-src.git synced 2026-04-22 15:38:49 +02:00
Commit Graph

2882 Commits

Author SHA1 Message Date
Nikita Popov 941a3b6ccd Remove unnecessary uses of CHECK_SILENT
If no error is passed, it is always silent.
2020-03-06 16:36:45 +01:00
Nikita Popov 33ef3d64da Use separate typedef for bucket comparison function
Avoid performing the same casting dance inside each sort compare
function.
2020-03-04 12:46:06 +01:00
Nikita Popov 53efa1b0c6 Store aliased name of trait method
Currently, trait methods are aliased will continue to use the
original function name. In a few places in the codebase, we will
try to look up the actual method name instead. However, this does
not work if an aliased method is used indirectly
(https://bugs.php.net/bug.php?id=69180).

I think it would be better to instead actually change the method
name to the alias. This is in principle easy: We have to allow
function_name to be changed even if op array is otherwise shared
(similar to static_variables). This means we need to addref/release
the function_name separately, but I don't think there is a
performance concern here (especially as everything is usually
interned).

There is a bit of complication in opcache, where we need to make
sure that the function name is released the correct number of times
(interning may overwrite the name in the original op_array, but we
need to release it as many times as the op_array is shared).

Fixes bug #69180.
Fixes bug #74939.
Closes GH-5226.
2020-03-03 11:55:48 +01:00
Nikita Popov bb85478bcc Merge branch 'PHP-7.4'
* PHP-7.4:
  Try to fix msvc build
2020-02-28 14:49:03 +01:00
Nikita Popov a7de98fb12 Try to fix msvc build 2020-02-28 14:48:02 +01:00
Máté Kocsis 3ab75ac019 Update MySQLi function info
Closes GH-5214
2020-02-28 14:36:54 +01:00
Nikita Popov 519a72e0b4 Merge branch 'PHP-7.4'
* PHP-7.4:
  Fixed bug #79252
2020-02-28 12:49:45 +01:00
Nikita Popov 30ee3f48d4 Fixed bug #79252 2020-02-28 12:47:56 +01:00
Dmitry Stogov 63761d1133 Merge branch 'PHP-7.4'
* PHP-7.4:
  Fixed incorrect overflow detection
2020-02-27 23:38:19 +03:00
Dmitry Stogov cb88184420 Merge branch 'PHP-7.3' into PHP-7.4
* PHP-7.3:
  Fixed incorrect overflow detection
2020-02-27 23:38:09 +03:00
Dmitry Stogov 5b51b633e2 Fixed incorrect overflow detection 2020-02-27 23:37:41 +03:00
Nikita Popov 819a872cfa Avoid more null arithmetic 2020-02-27 14:48:43 +01:00
Nikita Popov 5a90392c6a Use EX_NUM_TO_VAR() in more places
Not sure why I missed these before.
2020-02-27 13:13:24 +01:00
Nikita Popov 1949a26aac Remove more null arithmetic UB
Introduce an EX_NUM_TO_VAR macro to mirror EX_VAR_TO_NUM and
replace usages of the ZEND_CALL_VAR_NUM(NULL) pattern.
2020-02-27 12:54:48 +01:00
Máté Kocsis ac0853eb26 Make type error messages more consistent
Closes GH-5092
2020-02-17 14:22:17 +01:00
Nikita Popov 72bd55902d Improve generated names for anonymous classes
In order of preference, the generated name will be:

    new class extends ParentClass {};
    // -> ParentClass@anonymous
    new class implements FirstInterface, SecondInterface {};
    // -> FirstInterface@anonymous
    new class {};
    // -> class@anonymous

This is intended to display a more useful class name in error messages
and stack traces, and thus make debugging easier.

Closes GH-5153.
2020-02-17 12:21:33 +01:00
Nikita Popov 43443857b7 Add static return type
RFC: https://wiki.php.net/rfc/static_return_type

The "static" type is represented as MAY_BE_STATIC, rather than
a class type like "self" and "parent", as it has special
resolution semantics, and cannot be cached in the runtime cache.

Closes GH-5062.
2020-02-17 11:51:09 +01:00
Dmitry Stogov cf8407a238 Fixed bug #79255 (PHP cannot be compiled with enable JIT) 2020-02-17 12:03:49 +03:00
Nikita Popov 7a8f180b19 Revert "Fixed bug #79255 (PHP cannot be compiled with enable JIT)"
This reverts commit de6984edd5.

Reverting to unbreak 32-bit CI.
2020-02-17 09:34:56 +01:00
Xinchen Hui de6984edd5 Fixed bug #79255 (PHP cannot be compiled with enable JIT) 2020-02-17 13:13:49 +08:00
Nikita Popov f3d8ac1d95 Fix JIT trait type errors
We need to load EX->func here rather than use a hardcoded op_array,
as it may be copied with adjusted scope for traits.
2020-02-13 15:16:23 +01:00
Dmitry Stogov b79af3d4df Removed unused macro 2020-02-11 17:30:49 +03:00
Nikita Popov d933591674 Add support for $obj::class
This allows $obj::class, which gives the same result as get_class($obj).
Anything other than an object results in TypeError.

RFC: https://wiki.php.net/rfc/class_name_literal_on_object

Closes GH-5065.
2020-02-11 12:16:30 +01:00
Dmitry Stogov a9e35b843c Save delayed call frame 2020-02-10 13:43:32 +03:00
Dmitry Stogov cf8dc1c1a2 typo 2020-02-07 14:21:56 +03:00
Dmitry Stogov 64b40f69dc Make ASSIGN, ASSIGN_OP, INC and DEC opcodes to return IS_TMP_VAR instead of IS_VAR.
This helps to avoid unnecessary IS_REFERENCE checks.
This changes some notices "Only variables should be passed by reference" to exception "Cannot pass parameter %d by reference".

Also, for consistency, compile-time fatal error "Only variables can be passed by reference" was converted to exception "Cannot pass parameter %d by reference"
2020-02-07 13:36:52 +03:00
Dmitry Stogov ad3f768253 Fixed stack alignment 2020-02-07 13:00:48 +03:00
Nikita Popov d8840a1b69 Try to fix Windows build 2020-02-07 12:59:48 +03:00
Nikita Popov bc6bab6cb4 Basic JIT support for verify return 2020-02-07 12:59:48 +03:00
Dmitry Stogov 170cc10519 Fixed JIT for PTR_INC instruction to return de-referenced value of reference 2020-02-06 21:29:43 +03:00
Nikita Popov f57f0920fd Remove ZEND_ACC_IMPLEMENTS_TRAITS flag
This is equivalent to checking ce->num_traits.
2020-02-06 10:45:49 +01:00
Nikita Popov 4f5f72c7af Remove ZEND_ACC_INHERITED flag
It is equivalent to checking ce->parent != NULL. Just adds more
state that needs to be kept in sync.
2020-02-06 10:42:25 +01:00
Dmitry Stogov daee985709 Fixed JIT for BIND_GLOBAL 2020-02-04 15:56:55 +03:00
Nikita Popov f8d795820e Reindent phpt files 2020-02-03 22:52:20 +01:00
Dmitry Stogov 2b279b428f We don't need "safe" destruction anymore 2020-01-31 16:01:09 +03:00
Dmitry Stogov 6b862e82d9 These EG(current_execute_data) = EX(prev_execute_data) assignments are useless now 2020-01-31 14:50:41 +03:00
Dmitry Stogov 08d2d9257d Export zend_dump_op() and add ZEND_DUMP_NUMERIC_OPLINES flag to print oplines as "dddd" instead of "Ld+" 2020-01-31 13:27:35 +03:00
Nikita Popov d8a1e3dab0 Fix JIT as well 2020-01-31 10:35:46 +01:00
Dmitry Stogov 7e7a85e881 Fixed JIT part for bug #79094 2020-01-31 10:39:22 +03:00
Nikita Popov b33697d47e Merge branch 'PHP-7.4'
* PHP-7.4:
  Fixed bug #79193
2020-01-30 14:56:31 +01:00
Nikita Popov f70b552326 Fixed bug #79193 2020-01-30 14:55:58 +01:00
Tyson Andre 5f92a085cc Convert ZEND_ECHO operand to string after sccp
And filter out echoes of the empty string (e.g. false/null)

Split out of #5097 (on GitHub)

Closes GH-5118
2020-01-27 20:21:24 -05:00
Nikita Popov ebd00c5b65 Merge branch 'PHP-7.4'
* PHP-7.4:
  Fixed bug #79128
2020-01-24 16:20:30 +01:00
Nikita Popov 3291891408 Fixed bug #79128
We need to extend the hash table before performing raw append
operations.

This doesn't matter if preloading happens in the same process,
as the tables will be large enough to hold all entries as a
side-effect of the preloading process. However, if preloading
happens in a different process, we need to reserve space here.
2020-01-24 16:18:48 +01:00
Xinchen Hui ce5d722a6d Merge branch 'PHP-7.4'
* PHP-7.4:
  Let's make this safer from maliciously crafted filename
2020-01-20 12:35:08 +08:00
Xinchen Hui 2958cdc0b5 Let's make this safer from maliciously crafted filename 2020-01-20 12:33:37 +08:00
Xinchen Hui 5aa12d2e32 Merge branch 'PHP-7.4'
* PHP-7.4:
  minor cleanup
2020-01-20 12:29:23 +08:00
Xinchen Hui dda2addab2 minor cleanup 2020-01-20 12:28:57 +08:00
Xinchen Hui 31dd635eb3 Merge branch 'PHP-7.4'
* PHP-7.4:
  Fixed bug #79114 (Eval class during preload causes class to be only half available)
2020-01-20 12:25:10 +08:00
Xinchen Hui 9c2fd55d01 Fixed bug #79114 (Eval class during preload causes class to be only half available) 2020-01-20 12:24:49 +08:00