1
0
mirror of https://github.com/php/php-src.git synced 2026-03-24 08:12:21 +01:00
Commit Graph

119028 Commits

Author SHA1 Message Date
Dmitry Stogov
a60cdcf084 A helper to trace executed source lines 2020-06-10 00:13:39 +03:00
Dmitry Stogov
e9f295ac84 Tracing JIT support for megamorphic calls 2020-06-09 23:33:22 +03:00
Christoph M. Becker
4edce91fae Avoid unnecessary linking of Windows DLLs
For snapshot builds (`--enable-snapshot-build`), after the build has
been completely finished, running `nmake` causes a lot of DLLs to be
rebuilt.  The problem is that the build folders OptimizerObj and
opcache_jit are dependencies of the main PHP DLL, but these folders do
not exists in the source tree, so nmake assumes it has to re-link the
main PHP DLL, and that makes several other DLLs stale.

We solve that by mirroring the folder structure of the respective
source folders.
2020-06-09 18:37:37 +02:00
Javier Eguiluz
066a378316 [ci skip] Fixed some minor typos in code comments 2020-06-09 17:17:55 +02:00
Christoph M. Becker
34ede22fd8 Merge branch 'PHP-7.4'
* PHP-7.4:
  Fix possibly unsupported timercmp() usage
2020-06-09 16:56:35 +02:00
Christoph M. Becker
3c12c41927 Merge branch 'PHP-7.3' into PHP-7.4
* PHP-7.3:
  Fix possibly unsupported timercmp() usage
2020-06-09 16:54:43 +02:00
Christoph M. Becker
7ac0fb5ae4 Fix possibly unsupported timercmp() usage
The `timercmp()` manpage[1] points out that some systems have a broken
implementation which does not support `>=`.  This is definitely the
case for the Windows SDK, which only supports `<` and `>`.

[1] <https://linux.die.net/man/3/timercmp>
2020-06-09 16:52:19 +02:00
Christoph M. Becker
4b76a2ddb3 Merge branch 'PHP-7.4'
* PHP-7.4:
  Fix #62890: default_socket_timeout=-1 causes connection to timeout
2020-06-09 16:48:41 +02:00
Nikita Popov
3b8d26accf Remove obsolete __lambda_func handling
This is a leftover from create_function() support.
2020-06-09 16:47:40 +02:00
Christoph M. Becker
85657b486f Merge branch 'PHP-7.3' into PHP-7.4
* PHP-7.3:
  Fix #62890: default_socket_timeout=-1 causes connection to timeout
2020-06-09 16:47:00 +02:00
Christoph M. Becker
eadd980706 Fix #62890: default_socket_timeout=-1 causes connection to timeout
While unencrypted connections ignore negative timeouts, SSL/TLS
connections did not special case that, and so always failed due to
timeout.
2020-06-09 16:45:34 +02:00
Christoph M. Becker
beddb97b4c Merge branch 'PHP-7.4'
* PHP-7.4:
  [ci skip] Update NEWS
2020-06-09 16:40:56 +02:00
Christoph M. Becker
5d3da2e748 Merge branch 'PHP-7.3' into PHP-7.4
* PHP-7.3:
  [ci skip] Update NEWS
2020-06-09 16:39:34 +02:00
Christoph M. Becker
eac700b1e6 [ci skip] Update NEWS 2020-06-09 16:37:17 +02:00
Nikita Popov
e56e53a59d Back up fake_scope in zend_call_function
We regularly find new places where we forgot to reset fake_scope.
Instead of having to handle this for each caller of zend_call_function()
and similar APIs, handle it directly in zend_call_function().
2020-06-09 16:33:33 +02:00
Nikita Popov
257dbb0450 Add zend_call_known_function() API family
This adds the following APIs:

void zend_call_known_function(
    zend_function *fn, zend_object *object, zend_class_entry *called_scope,
    zval *retval_ptr, int param_count, zval *params);

void zend_call_known_instance_method(
    zend_function *fn, zend_object *object, zval *retval_ptr, int param_count, zval *params);
void zend_call_known_instance_method_with_0_params(
    zend_function *fn, zend_object *object, zval *retval_ptr);
void zend_call_known_instance_method_with_1_params(
    zend_function *fn, zend_object *object, zval *retval_ptr, zval *param);
void zend_call_known_instance_method_with_2_params(
    zend_function *fn, zend_object *object, zval *retval_ptr, zval *param1, zval *param2);

These are used to perform a call if you already have the
zend_function you want to call. zend_call_known_function()
is the base API, the rest are just really thin wrappers around
it for the common case of instance method calls.

Closes GH-5692.
2020-06-09 16:21:54 +02:00
Nikita Popov
bcada03f48 Merge branch 'PHP-7.4'
* PHP-7.4:
  Fixed bug #79683
2020-06-09 15:52:48 +02:00
Nikita Popov
2447fd9f84 Fixed bug #79683
Reset fake_scope during __toString() call.

I'll check if we can solve this more globally in master, by
resetting fake_scope in zend_call_function.
2020-06-09 15:51:05 +02:00
Dmitry Stogov
797c1c5088 Tracing JIT support for real dynamic calls 2020-06-09 14:02:02 +03:00
George Peter Banyard
4b77a158ef Use standard boolean type as zend_bool typedef
Closes GH-5624
2020-06-09 11:43:45 +02:00
George Peter Banyard
c14371ef7b Fix incorrect zend_bool usage for display_errors 2020-06-09 11:43:37 +02:00
George Peter Banyard
9fbc31704d Fix incorrect usage of zend_bool in Zend globals 2020-06-09 11:43:37 +02:00
Nikita Popov
be540b35d2 Remove some special-casing in zend_call_method()
Don't treat the !fn_proxy && !obj_ce case differently. There doesn't
seem to be any need for it, and it will result in subtly different
behavior (e.g. it will accept "Foo::bar" syntax, but break as soon
as you pass in an fn_proxy cache).
2020-06-09 10:10:58 +02:00
Máté Kocsis
596561009c Fix some UNKNOWN default values
In ext/ffi, ext/intl, ext/mysqli, and ext/pcntl
2020-06-09 09:46:51 +02:00
Christoph M. Becker
cadcefc956 Fix new test case for master 2020-06-09 08:50:09 +02:00
Peter Kokot
fe2afef36f Fix #78750: configure assumes yacc and re2c work
Closes GH-5681
2020-06-09 00:46:12 +02:00
Ilija Tovilo
2a3ac4a8e7 Add missing terminators in zend_language_parser.y
Closes GH-5688
2020-06-09 00:44:13 +02:00
twosee
05ed7bff17 Make zend_argument_error_variadic static
Closes GH-5687
2020-06-09 00:42:48 +02:00
Christoph M. Becker
383a9f46ad Merge branch 'PHP-7.4'
* PHP-7.4:
  Fix #74267: segfault with streams and invalid data
2020-06-08 23:28:36 +02:00
Christoph M. Becker
ee4683cf28 Merge branch 'PHP-7.3' into PHP-7.4
* PHP-7.3:
  Fix #74267: segfault with streams and invalid data
2020-06-08 23:22:49 +02:00
Christoph M. Becker
12c59f6660 Fix #74267: segfault with streams and invalid data
If the current character is a line break character, it cannot be a tab
or space character, so we would always fail with an invalid sequence
error.  Obviously, these `scan_stat == 4` conditions are meant to be
exclusive.

Furthermore, if `in_pp == NULL || in_left_p == NULL` is true, we hit a
segfault if we are not returning right away.  Obviously, the additional
constraints don't make sense, so we remove them.
2020-06-08 23:19:43 +02:00
twosee
83a77015ad Add helper APIs for maybe-interned string creation
Add ZVAL_CHAR/RETVAL_CHAR/RETURN_CHAR as a shortcut for using
ZVAL_INTERNED_STRING and ZSTR_CHAR.

Add zend_string_init_fast() as a helper for the empty string /
one char interned string / zend_string_init() pattern.

Also add corresponding ZVAL_STRINGL_FAST etc macros.

Closes GH-5684.
2020-06-08 15:31:52 +02:00
Tyson Andre
543684e796 Optimize out no-op yield from statements
If the array is empty, then I'd expect that the generator is never left,
and that can be converted to a no-op and the return value would always be `null`.

Make `yield from [];` as efficient as `if (false) { yield null; }`
when opcache's sccp pass is enabled.

Closes GH-5679
2020-06-08 09:17:13 -04:00
Nikita Popov
3d4f79d678 Don't allow variables as attribute name
Attributes require a static class name...

This fixes https://oss-fuzz.com/testcase-detail/6267052359942144.
2020-06-08 14:34:43 +02:00
Nikita Popov
b03cafd19c Fix bug #77966: Cannot alias a method named "namespace"
This is a bit tricky: In this cases we have "namespace as", which
means that we will only recognize "namespace" as an identifier when
the lookahead token is already at the "as". This means that
zend_lex_tstring picks up the wrong identifier.

We solve this by actually assigning the identifier as the semantic
value on the parser stack -- as in almost all cases we will not
actually need the identifier, this is just an (offset, size)
reference, not a copy of the string.

Additionally, we need to teach the lexer feedback mechanism used
by tokenizer TOKEN_PARSE mode to apply feedback to something
other than the very last token. To that purpose we pass through
the token text and check the tokens in reverse order to find the
right one.

Closes GH-5668.
2020-06-08 12:55:14 +02:00
Phil Davis
08518b18b2 Fix typo of IteratorAggregateImpl
Closes GH-5682.
2020-06-08 12:28:15 +02:00
Nikita Popov
57f408e87c Merge branch 'PHP-7.4'
* PHP-7.4:
  Fixed bug #79657
2020-06-08 11:32:24 +02:00
Nikita Popov
df2db7fcea Fixed bug #79657
Throwing an exception should count as an initialization for this
purpose.
2020-06-08 11:31:28 +02:00
Dmitry Stogov
13909e5555 Fixed incorrect zend_bool type usage 2020-06-08 12:18:05 +03:00
twosee
88355dd338 Constify char * arguments of APIs
Closes GH-5676.
2020-06-08 10:38:45 +02:00
Nikita Popov
f6db43fec8 Merge branch 'PHP-7.4'
* PHP-7.4:
  Disable mysqlnd compression on msan build
2020-06-08 10:36:01 +02:00
Nikita Popov
9b39ddbb85 Disable mysqlnd compression on msan build
This recently got enabled when detection was fixed. However,
we don't want this for msan builds, because our zlib is not
instrumented.
2020-06-08 10:35:05 +02:00
Nikita Popov
57e17e58a5 Fix leak in openssl_cms_read() 2020-06-08 10:13:25 +02:00
Remi Collet
cd3f42f17e [skip ci] typo 2020-06-08 08:02:48 +02:00
Jens de Nies
45475c2e21 Deprecate function aliases in oci8 extension.
Closes GH-5589
2020-06-08 00:23:38 +02:00
Jakub Zelenka
367c55ff1d Update NEWS and UPGRADING for the OpenSSL ext CMS addition 2020-06-07 21:11:09 +01:00
Eliot Lear
8583b8a9bf Add support for Cryptographic Message Syntax (CMS)
It add CMS (RFC 5652) support, which is an update to PKCS7.  The functions
are analogous BUT NOT IDENTICAL to openssl_pkcs7*.  In particular, support for
different encodings (PEM, DER, SMIME) is now available.
2020-06-07 16:58:34 +01:00
Gabriel Caruso
7439941d55 Add $filter parameter for ReflectionClass::(getConstants|getReflectionConstants)
This solves [#79628](https://bugs.php.net/79628).

Similar to `ReflectionClass::getMethods()` and `ReflectionClass::getProperties()`,
this new `$filter` argument allows the filtering of constants defined in a class by
their visibility.

For that, we create three new constants for `ReflectionClassConstant`:

  * `IS_PUBLIC`
  * `IS_PROTECTED`
  * `IS_PRIVATE`

Closes GH-5649.
2020-06-07 15:57:48 +02:00
Gabriel Caruso
84492f5b50 Fix tests' description for ReflectionClass::getConstant 2020-06-07 15:46:39 +02:00
twosee
7d6a0ba808 Fix expression warnings and break warnings
Close GH-5675.
2020-06-07 10:41:11 +02:00