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

3142 Commits

Author SHA1 Message Date
Christoph M. Becker 5a04796f76 Fix MSVC level 1 (severe) warnings
We fix (hopefully) all instances of:

* <https://docs.microsoft.com/en-us/cpp/error-messages/compiler-warnings/compiler-warning-level-1-c4005>
* <https://docs.microsoft.com/en-us/cpp/error-messages/compiler-warnings/compiler-warning-level-1-c4024>
* <https://docs.microsoft.com/en-us/cpp/error-messages/compiler-warnings/compiler-warning-level-1-c4028>
* <https://docs.microsoft.com/en-us/cpp/error-messages/compiler-warnings/compiler-warning-level-1-c4047>
* <https://docs.microsoft.com/en-us/cpp/error-messages/compiler-warnings/compiler-warning-level-1-c4087>
* <https://docs.microsoft.com/en-us/cpp/error-messages/compiler-warnings/compiler-warning-level-1-c4090>
* <https://docs.microsoft.com/en-us/cpp/error-messages/compiler-warnings/compiler-warning-level-1-c4273>
* <https://docs.microsoft.com/en-us/cpp/error-messages/compiler-warnings/compiler-warning-level-1-c4312>

`zend_llist_add_element()` and `zend_llist_prepend_element()` now
explicitly expect a *const* pointer.

We use the macro `ZEND_VOIDP()` instead of a `(void*)` cast to suppress
C4090; this should prevent accidential removal of the cast by
clarifying the intention, and makes it easier to remove the casts if
the issue[1] will be resolved sometime.

[1] <https://developercommunity.visualstudio.com/content/problem/390711/c-compiler-incorrect-propagation-of-const-qualifie.html>
2020-06-05 11:17:05 +02:00
Nikita Popov 975acfe71e Pass zend_string message to zend_error_cb
This makes the zend_error_cb API simpler, and avoid formatting
the same message in multiple places.

It should be noted that the passed zend_string is always
non-persistent, so if you want to store it persistently somewhere,
you may still need to duplicate it.

The last_error_message is cleared a bit more aggressive, to make
sure it doesn't hang around across allocator life-cycles.

Closes GH-5639.
2020-06-05 09:54:02 +02:00
Dmitry Stogov bc37fc57e5 Avoid useless "mov" 2020-06-05 00:05:12 +03:00
Benjamin Eberlei a7908c2d11 Add Attributes
Co-authored-by: Martin Schröder <m.schroeder2007@gmail.com>
2020-06-04 18:19:49 +02:00
Dmitry Stogov 58801f7142 Add guard for FETCH_DIM_FUNC_ARG 2020-06-04 14:04:21 +03:00
Dmitry Stogov 8047c1d05c Prefer shorter x86 instructions 2020-06-04 13:19:42 +03:00
Dmitry Stogov efde51e197 Improved tracing JIT for FETCH_OBJ_R/IS 2020-06-04 12:23:27 +03:00
Dmitry Stogov 2745053799 Tracing JIT for FETCH_DIM_FUNC_ARG and FETCH_OBJ_FUNC_ARG when they are used in READ mode (to pass by value). 2020-06-04 10:03:15 +03:00
Dmitry Stogov c59edf0ad5 Fixed abstract stack consistency for JMPZ_EX/JMPNZ_EX 2020-06-04 00:17:13 +03:00
Dmitry Stogov 3fae143318 "call_info" doesn't matter 2020-06-03 22:50:40 +03:00
Dmitry Stogov 0badfc0880 Avoid useless register reload 2020-06-03 18:14:51 +03:00
Dmitry Stogov 3587fc5418 Avoid useless REFCOUNTED check 2020-06-03 12:11:39 +03:00
Christoph M. Becker d23cd354c0 Fix #79665: ini_get() and opcache_get_configuration() inconsistency
Overriding the given INI values in modifier callbacks is not possible,
so instead of enforcing "normalized" internal values, we just reject
the attempted changes.
2020-06-03 11:07:25 +02:00
Dmitry Stogov 72d1c50572 Use cheaper zend_rethrow_exception() instead of zend_throw_exception_internal() 2020-06-03 11:51:04 +03:00
Dmitry Stogov c93c3b4f0e Handle VM interrupts after DO_ICALL through side exits 2020-06-03 10:58:17 +03:00
Dmitry Stogov d237989f33 Avoid reference counting when RETURN CV 2020-06-03 00:49:10 +03:00
Dmitry Stogov 38f9d95ffa Added missed helper 2020-06-02 23:50:32 +03:00
Dmitry Stogov f733047ae2 Tracing JIT support for indirect CV modification (may be incomplete) 2020-06-02 15:55:18 +03:00
Dmitry Stogov 99053228b9 Afdded misse MAY_BE_ARRAY_* flags 2020-06-02 15:54:44 +03:00
Dmitry Stogov 2706615418 Fixed retutn type inference when return undefined variable 2020-06-01 16:26:22 +03:00
Dmitry Stogov b0613d16d7 Fixed tracing JIT for closure run_time_cache access 2020-06-01 12:06:26 +03:00
Ilija Tovilo c599d173ab Fix php_get_args function info return type and add arg check
Closes GH-5648.
2020-05-31 17:15:58 +02:00
Nikita Popov ec3ee1f173 Fix Windows build 2020-05-29 12:58:31 +02:00
Dmitry Stogov 8e8c5a73ee Fixed tracing JIT register allocator (failure on ext/opcache/tests/jit/assign_002.phpt) 2020-05-29 13:27:47 +03:00
Dmitry Stogov dc7a0fb236 Allow tracing JIT generate code when function exits from VM (e.g. for magic __get/__set) 2020-05-29 13:25:59 +03:00
Dmitry Stogov 7aa8c7e6aa Don't add guards that are not going to be checked 2020-05-29 12:17:09 +03:00
Dmitry Stogov de7a0df0a2 Fixed use-after-free in tracing JIT when recording closures and top-level op_arrays. 2020-05-29 00:45:28 +03:00
Tyson Andre 32a1ebbd43 Clean up calls to extension_loaded('json') in tests
These are no longer needed after https://wiki.php.net/rfc/always_enable_json

Closes GH-5637
2020-05-28 15:07:47 -04:00
Dmitry Stogov 784f1b5c49 Fixed tracing JIT type inference for passing undefined CV by value 2020-05-28 18:35:32 +03:00
Dmitry Stogov 0abe742d72 Fixed incorrect trace type inference for top-level code 2020-05-28 17:43:29 +03:00
Dmitry Stogov 1d98bd41e5 Fixed incorrect type inference 2020-05-28 17:10:05 +03:00
Dmitry Stogov c16dbed0c4 Avoid recording of uninitialized types.
VM doesn't set Z_TYPE() for IS_VAR when passes class_entry reference.
2020-05-28 14:39:41 +03:00
Dmitry Stogov efbe96166d Split "opcache.jit_max_recursion_unroll" into "opcache.jit_max_recursive_calls" and "opcache.jit_max_recursive_returns".
It's possible to disable recording of "recursive return loops" setting opcache.jit_max_recursive_returns to 0.
2020-05-28 12:28:05 +03:00
Nicolas Grekas caca664871 Fix func info for sodium_crypto_aead_xchacha20poly1305_ietf_decrypt 2020-05-28 10:44:26 +02:00
Dmitry Stogov 501a2e86e8 Add a side exit on enter to function if it may be called with different number of arguments. 2020-05-28 01:22:32 +03:00
Dmitry Stogov bd329a6019 Keep information about SEND_UNPACK/SEND_ARRAY in call_info 2020-05-27 22:15:14 +03:00
Dmitry Stogov d2d5738b32 Fixed tracing JIT support for ZEND_RETURN_BY_REF in CALL VM 2020-05-27 18:04:16 +03:00
Dmitry Stogov 0bf2bfcf8d Fixed tracing JIT for CALL VM 2020-05-27 17:05:06 +03:00
Dmitry Stogov 645ff9c8f6 Revert "Fixed tracing JIT for CALL VM"
This reverts commit 7f3a296f84.
2020-05-27 17:04:31 +03:00
Dmitry Stogov 7f3a296f84 Fixed tracing JIT for CALL VM 2020-05-27 15:59:29 +03:00
Dmitry Stogov f91283fcd4 Fixed JIT for ext/opcache/tests/bool_not_cv.phpt with opcache.jit=1202 2020-05-27 10:57:33 +03:00
Dmitry Stogov 6e5247275a Fixed JIT for ext/opcache/tests/jit/cmp_004.phpt with opcache.jit=1201 2020-05-27 09:59:12 +03:00
Dmitry Stogov d2f811438e Set proper jit_extension for inherited methods 2020-05-27 09:58:03 +03:00
Máté Kocsis 0de3ca4f98 Let's try to fix the JIT compiler warning 2020-05-26 20:56:29 +02:00
Máté Kocsis fbe30592d6 Improve type error messages when an object is given
From now on, we always display the given object's type instead of just reporting "object".
Additionally, make the format of return type errors match the format of argument errors.

Closes GH-5625
2020-05-26 19:06:19 +02:00
Christoph M. Becker 38c85efe83 Fix picky builds
Due to `-Werror=maybe-uninitialized` a bogus warning may be thrown, so
we initialize the variable to work-around that.
2020-05-26 18:37:29 +02:00
Dmitry Stogov 15aa891c5e Fixed JIT for integer overflow checks 2020-05-26 17:59:15 +03:00
Dmitry Stogov 59e69eb1c9 Fixed JIT for (LONG_MIN % -1) 2020-05-26 14:49:29 +03:00
Dmitry Stogov cf3b133a86 Fixed JIT for SEND_VAR $undefined_cv 2020-05-26 10:13:57 +03:00
Nikita Popov ca358001b9 Revert "Fixed JIT for SEND_VAR $undefined_cv"
This reverts commit d60988257b.

This change causes segfaults in many tests.
2020-05-25 23:51:11 +02:00