]> granicus.if.org Git - php/log
php
4 years agoTracing JIT support for include() and generators
Dmitry Stogov [Mon, 29 Jun 2020 18:40:49 +0000 (21:40 +0300)]
Tracing JIT support for include() and generators

4 years agoDon't record "fake" closures
Dmitry Stogov [Mon, 29 Jun 2020 17:37:50 +0000 (20:37 +0300)]
Don't record "fake" closures

4 years agoFix macro redifinition warnings in debug builds
Christoph M. Becker [Mon, 29 Jun 2020 15:25:45 +0000 (17:25 +0200)]
Fix macro redifinition warnings in debug builds

MSVC considers these warnings[1] to be severe (level 1), so we better
fix the respective code.

[1] <https://docs.microsoft.com/en-us/cpp/error-messages/compiler-warnings/compiler-warning-level-1-c4005?view=vs-2019>

4 years agoMerge branch 'PHP-7.4'
Christoph M. Becker [Mon, 29 Jun 2020 17:06:56 +0000 (19:06 +0200)]
Merge branch 'PHP-7.4'

* PHP-7.4:
  Fix #63208: BSTR to PHP string conversion not binary safe

4 years agoMerge branch 'PHP-7.3' into PHP-7.4
Christoph M. Becker [Mon, 29 Jun 2020 17:05:37 +0000 (19:05 +0200)]
Merge branch 'PHP-7.3' into PHP-7.4

* PHP-7.3:
  Fix #63208: BSTR to PHP string conversion not binary safe

4 years agoFix #63208: BSTR to PHP string conversion not binary safe
Christoph M. Becker [Mon, 29 Jun 2020 15:38:14 +0000 (17:38 +0200)]
Fix #63208: BSTR to PHP string conversion not binary safe

A `BSTR` is similar to a `zend_string`; it stores the length of the
string just before the actual string, and thus the string may contain
NUL bytes.  However, `php_com_olestring_to_string()` is supposed to
deal with arbitrary `OLECHAR*`s which may not be `BSTR`s, so we
introduce `php_com_bstr_to_string()` and use it for the only case where
we actually have to deal with `BSTR`s which may contain NUL bytes.

Contrary to `php_com_olestring_to_string()` we return a `zend_string`,
so we can save the re-allocation when converting to a `zval`.

We also cater to `php_com_string_to_olestring()` not being binary safe,
with basically the same fix we did for `php_com_olestring_to_string()`.

4 years agoMerge branch 'PHP-7.4'
Christoph M. Becker [Mon, 29 Jun 2020 15:47:21 +0000 (17:47 +0200)]
Merge branch 'PHP-7.4'

* PHP-7.4:
  Fix #79756: finfo_file crash (FILEINFO_MIME)

4 years agoMerge branch 'PHP-7.3' into PHP-7.4
Christoph M. Becker [Mon, 29 Jun 2020 15:46:31 +0000 (17:46 +0200)]
Merge branch 'PHP-7.3' into PHP-7.4

* PHP-7.3:
  Fix #79756: finfo_file crash (FILEINFO_MIME)

4 years agoFix #79756: finfo_file crash (FILEINFO_MIME)
Christoph M. Becker [Mon, 29 Jun 2020 14:10:33 +0000 (16:10 +0200)]
Fix #79756: finfo_file crash (FILEINFO_MIME)

If `ctime` or `asctime` return `NULL`, we must not attempt to copy the
buffer, but rather return `NULL` as well.

4 years agoFix #79749: Converting FFI instances to bool fails
Christoph M. Becker [Mon, 29 Jun 2020 13:39:17 +0000 (15:39 +0200)]
Fix #79749: Converting FFI instances to bool fails

Casting objects to bool is supposed to yield `true`.  Since the
`cast_object` handler is required now, we have to implement the
`_IS_BOOL` conversion there.

4 years agoDon't accept objects instead of arrays in curl
Nikita Popov [Fri, 26 Jun 2020 10:35:52 +0000 (12:35 +0200)]
Don't accept objects instead of arrays in curl

This properly addresses the issue from bug #79741. Silently
interpreting objects as mangled property tables is almost
always a bad idea.

Closes GH-5773.

4 years agoMake exit() unwind properly
Nikita Popov [Fri, 6 Mar 2020 13:57:55 +0000 (14:57 +0100)]
Make exit() unwind properly

exit() is now internally implemented by throwing an exception,
performing a normal stack unwind and a clean shutdown. This ensures
that no persistent resource leaks occur.

The exception is internal, cannot be caught and does not result in
the execution of finally blocks. This may be relaxed in the future.

Closes GH-5768.

4 years agoFixed bug #79743 (Fatal error when assigning to array property with JIT enabled)
Xinchen Hui [Mon, 29 Jun 2020 09:47:21 +0000 (17:47 +0800)]
Fixed bug #79743 (Fatal error when assigning to array property with JIT enabled)

simple typo

4 years agoImplement Attribute Amendments.
Martin Schröder [Sun, 28 Jun 2020 17:16:33 +0000 (19:16 +0200)]
Implement Attribute Amendments.

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

Support for attribute grouping is left out, because the short
attribute syntax RFC will likely make it obsolete.

Closes GH-5751.

4 years agoFixed bug #79737 (Building embed as static fails during install step).
Dmitry Stogov [Mon, 29 Jun 2020 08:14:20 +0000 (11:14 +0300)]
Fixed bug #79737 (Building embed as static fails during install step).

4 years agoRemove restriction on method call inlining
Nikita Popov [Mon, 29 Jun 2020 07:54:31 +0000 (09:54 +0200)]
Remove restriction on method call inlining

In PHP 8, we are guaranteed that $this exists, so we no longer have
to forbid this case.

4 years agoMerge branch 'PHP-7.4'
Nikita Popov [Mon, 29 Jun 2020 07:53:09 +0000 (09:53 +0200)]
Merge branch 'PHP-7.4'

* PHP-7.4:
  Don't inline static call to instance method

4 years agoDon't inline static call to instance method
Nikita Popov [Mon, 29 Jun 2020 07:52:37 +0000 (09:52 +0200)]
Don't inline static call to instance method

Fixes the failure in bug79740.phpt with opcache.

4 years agoDrop non-well formed numeric strings from math function tests
George Peter Banyard [Fri, 26 Jun 2020 19:14:24 +0000 (21:14 +0200)]
Drop non-well formed numeric strings from math function tests

4 years agoDrop non-well numeric string in Intl test
George Peter Banyard [Sun, 28 Jun 2020 15:49:54 +0000 (17:49 +0200)]
Drop non-well numeric string in Intl test

4 years agoDrop non-well formed numeric strings in array function tests
George Peter Banyard [Sun, 28 Jun 2020 16:03:10 +0000 (18:03 +0200)]
Drop non-well formed numeric strings in array function tests

4 years agoDrop non-well formed numeric strings in strings function tests
George Peter Banyard [Sun, 28 Jun 2020 16:13:43 +0000 (18:13 +0200)]
Drop non-well formed numeric strings in strings function tests

4 years agoSimplify and fix php-cgi detection
Nikita Popov [Fri, 26 Jun 2020 10:46:04 +0000 (12:46 +0200)]
Simplify and fix php-cgi detection

Make it work for installed PHP binaries.

4 years agoMerge branch 'PHP-7.4'
Nikita Popov [Fri, 26 Jun 2020 10:29:43 +0000 (12:29 +0200)]
Merge branch 'PHP-7.4'

* PHP-7.4:
  Fixed bug #79741

4 years agoMerge branch 'PHP-7.3' into PHP-7.4
Nikita Popov [Fri, 26 Jun 2020 10:29:23 +0000 (12:29 +0200)]
Merge branch 'PHP-7.3' into PHP-7.4

* PHP-7.3:
  Fixed bug #79741

4 years agoFixed bug #79741
Nikita Popov [Fri, 26 Jun 2020 10:26:46 +0000 (12:26 +0200)]
Fixed bug #79741

4 years agoHaiku proc_open build fix, *pty api resides on the BSD library
David Carlier [Fri, 26 Jun 2020 09:23:52 +0000 (09:23 +0000)]
Haiku proc_open build fix, *pty api resides on the BSD library

Closes GH-5770.

4 years agoBetter leak fix for cgi -s / -w
Nikita Popov [Fri, 26 Jun 2020 09:07:55 +0000 (11:07 +0200)]
Better leak fix for cgi -s / -w

We also need to go through request shutdown. The naming is a bit
confusing, but it's fine to go through fastcgi_request_done even
if not using fastcgi. Whether we loop or not is checked separately.

4 years agoCache __unserialize() instead of unserialize()
Nikita Popov [Fri, 26 Jun 2020 08:54:40 +0000 (10:54 +0200)]
Cache __unserialize() instead of unserialize()

We should use these cache slots for the new object serialization
mechanism rather than the old one.

4 years agoMerge branch 'PHP-7.4'
Nikita Popov [Fri, 26 Jun 2020 08:32:40 +0000 (10:32 +0200)]
Merge branch 'PHP-7.4'

* PHP-7.4:
  Fixed bug #79740

4 years agoFixed bug #79740
Nikita Popov [Fri, 26 Jun 2020 08:31:55 +0000 (10:31 +0200)]
Fixed bug #79740

4 years agoUse cheaper zend_hash_find_ex() to handle IS_CONST index
Dmitry Stogov [Fri, 26 Jun 2020 08:18:04 +0000 (11:18 +0300)]
Use cheaper zend_hash_find_ex() to handle IS_CONST index

4 years agoFix uninitialized reads in min/max
Nikita Popov [Fri, 26 Jun 2020 07:36:17 +0000 (09:36 +0200)]
Fix uninitialized reads in min/max

We need to use the unstable comparison function here, the fallback
order is not initialized in this context.

4 years agoClear last error before shutting down memory manager
Nikita Popov [Thu, 25 Jun 2020 14:12:55 +0000 (16:12 +0200)]
Clear last error before shutting down memory manager

The last error is allocated using ZMM, make sure it's cleared
beforehand.

It would probably be better to allocate it persistently outside
of requests.

4 years ago[ci skip] Various typo fixes in stub comments and CHANGES file
Ayesh Karunaratne [Thu, 25 Jun 2020 20:45:29 +0000 (03:45 +0700)]
[ci skip] Various typo fixes in stub comments and CHANGES file

4 years agoFixed incorrect type guard
Dmitry Stogov [Thu, 25 Jun 2020 18:59:48 +0000 (21:59 +0300)]
Fixed incorrect type guard

4 years agoMove exception check to cold path.
Dmitry Stogov [Thu, 25 Jun 2020 17:11:23 +0000 (20:11 +0300)]
Move exception check to cold path.

4 years agoOptimization for +/- int(0)
Dmitry Stogov [Thu, 25 Jun 2020 16:09:54 +0000 (19:09 +0300)]
Optimization for +/- int(0)

4 years agoImprove tracing JIT for FETCH_THIS + FETCH_OBJ_*
Dmitry Stogov [Thu, 25 Jun 2020 14:33:53 +0000 (17:33 +0300)]
Improve tracing JIT for FETCH_THIS + FETCH_OBJ_*

4 years agoFix leaks in cgi strip/highlight mode
Nikita Popov [Thu, 25 Jun 2020 14:06:20 +0000 (16:06 +0200)]
Fix leaks in cgi strip/highlight mode

4 years agoFix leaks in Phar::webPhar()
Nikita Popov [Thu, 25 Jun 2020 13:42:32 +0000 (15:42 +0200)]
Fix leaks in Phar::webPhar()

4 years agoDon't throw warning if exception thrown during dom validation
Nikita Popov [Thu, 25 Jun 2020 13:24:01 +0000 (15:24 +0200)]
Don't throw warning if exception thrown during dom validation

4 years agoAvoid warning on exception in xsl ext
Nikita Popov [Thu, 25 Jun 2020 13:06:53 +0000 (15:06 +0200)]
Avoid warning on exception in xsl ext

4 years agoensure all files have same date in official archives
Remi Collet [Thu, 25 Jun 2020 12:38:49 +0000 (14:38 +0200)]
ensure all files have same date in official archives

4 years agoAvoid $this check
Dmitry Stogov [Thu, 25 Jun 2020 11:08:21 +0000 (14:08 +0300)]
Avoid $this check

4 years agoCheaper exception checks
Dmitry Stogov [Thu, 25 Jun 2020 10:23:43 +0000 (13:23 +0300)]
Cheaper exception checks

4 years agoDon't include trailing newline in comment token
Nikita Popov [Sat, 15 Feb 2020 16:54:02 +0000 (17:54 +0100)]
Don't include trailing newline in comment token

Don't include a trailing newline in T_COMMENT tokens, instead leave
it for a following T_WHITESPACE token. The newline does not belong
to the comment logically, and this makes for an ugly special case,
as other tokens do not include trailing newlines.

Whitespace-sensitive tooling will want to either forward or backward
emulate this change.

Closes GH-5182.

4 years agoMake sorting stable
Nikita Popov [Wed, 4 Mar 2020 10:52:55 +0000 (11:52 +0100)]
Make sorting stable

Make user-exposed sorts stable, by storing the position of elements
in the original array, and using those positions as a fallback
comparison criterion. The base sort is still hybrid q/insert.

The use of true/false comparison functions is deprecated (but still
supported) and should be replaced by -1/0/1 comparison functions,
driven by the <=> operator.

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

Closes GH-5236.

4 years agoIncrease timeout on sanitizer job
Nikita Popov [Thu, 25 Jun 2020 08:36:19 +0000 (10:36 +0200)]
Increase timeout on sanitizer job

This is starting to hit the limit. Let it run for 3:30 hours.

4 years agoDon't use iterator_funcs_ptr if it is null
Nikita Popov [Thu, 25 Jun 2020 08:30:40 +0000 (10:30 +0200)]
Don't use iterator_funcs_ptr if it is null

This avoids ubsan warnings. Alternatively we could always initialize
iterator_funcs_ptr for aggregates, instead of doing so only for
non-internal ones.

4 years agoRemove useless prototype for spl_heap_get_iterator
Alex Dowad [Tue, 12 May 2020 18:46:05 +0000 (20:46 +0200)]
Remove useless prototype for spl_heap_get_iterator

4 years agoFix {{{ comment to match function name for php_replace_controlchars_ex
Alex Dowad [Fri, 24 Apr 2020 21:04:48 +0000 (23:04 +0200)]
Fix {{{ comment to match function name for php_replace_controlchars_ex

4 years agoCorrect comment in plain_wrapper.c (refers to microseconds, not milliseconds)
Alex Dowad [Fri, 24 Apr 2020 20:37:17 +0000 (22:37 +0200)]
Correct comment in plain_wrapper.c (refers to microseconds, not milliseconds)

4 years agoUpdate UPGRADING.INTERNALS re: removed --disable-inline-optimization switch
Alex Dowad [Thu, 18 Jun 2020 05:56:19 +0000 (07:56 +0200)]
Update UPGRADING.INTERNALS re: removed --disable-inline-optimization switch

This build configuration switch was removed in 3a19726bce.

4 years agoSort extensions alphabetically
Nikita Popov [Wed, 24 Jun 2020 14:58:50 +0000 (16:58 +0200)]
Sort extensions alphabetically

This makes it easier to compare mime data from different sources.

4 years agoGenerate tabs in generate_mime_type_map.php
Nikita Popov [Wed, 24 Jun 2020 14:31:46 +0000 (16:31 +0200)]
Generate tabs in generate_mime_type_map.php

The PHP file is space indented, but we need the C file to be tab
indented.

4 years agoIntroduce InternalIterator
Nikita Popov [Wed, 26 Feb 2020 15:42:49 +0000 (16:42 +0100)]
Introduce InternalIterator

Userland classes that implement Traversable must do so either
through Iterator or IteratorAggregate. The same requirement does
not exist for internal classes: They can implement the internal
get_iterator mechanism, without exposing either the Iterator or
IteratorAggregate APIs. This makes them usable in get_iterator(),
but incompatible with any Iterator based APIs.

A lot of internal classes do this, because exposing the userland
APIs is simply a lot of work. This patch alleviates this issue by
providing a generic InternalIterator class, which acts as an
adapater between get_iterator and Iterator, and can be easily
used by many internal classes. At the same time, we extend the
requirement that Traversable implies Iterator or IteratorAggregate
to internal classes as well.

Closes GH-5216.

4 years agoMake SimpleXMLElement a RecursiveIterator
Nikita Popov [Wed, 4 Mar 2020 09:53:47 +0000 (10:53 +0100)]
Make SimpleXMLElement a RecursiveIterator

Context: https://externals.io/message/108789

This essentially moves the functionality of SimpleXMLIterator into
SimpleXMLElement, and makes SimpleXMLIterator a no-op extension.

Ideally SimpleXMLElement would be an IteratorAggregate, whose
getIterator() method returns SimpleXMLIterator. However, because
SimpleXMLIterator extends SimpleXMLElement (and code depends on
this in non-trivial ways), this is not possible.

The only way to not keep SimpleXMLElement as a magic Traversable
(that implements neither Iterator nor IteratorAggregate) is to
move the SimpleXMLIterator functionality into it.

Closes GH-5234.

4 years agoAdd the ZEND_ACC_NO_DYNAMIC_PROPERTIES flag to Shmop
Máté Kocsis [Wed, 24 Jun 2020 12:55:49 +0000 (14:55 +0200)]
Add the ZEND_ACC_NO_DYNAMIC_PROPERTIES flag to Shmop

4 years agoMerge branch 'PHP-7.4'
Nikita Popov [Wed, 24 Jun 2020 12:43:13 +0000 (14:43 +0200)]
Merge branch 'PHP-7.4'

* PHP-7.4:
  Fixed bug #79030 Use usec from apache request time

4 years agoMerge branch 'PHP-7.3' into PHP-7.4
Nikita Popov [Wed, 24 Jun 2020 12:42:52 +0000 (14:42 +0200)]
Merge branch 'PHP-7.3' into PHP-7.4

* PHP-7.3:
  Fixed bug #79030 Use usec from apache request time

4 years agoFixed bug #79030 Use usec from apache request time
Herbert256 [Wed, 24 Jun 2020 07:44:35 +0000 (09:44 +0200)]
Fixed bug #79030 Use usec from apache request time

Don't unnecessarily truncate to milliseconds.

Closes GH-5760.

4 years agoConvert shmop resources to opaque objects
Christoph M. Becker [Mon, 8 Jun 2020 15:58:08 +0000 (17:58 +0200)]
Convert shmop resources to opaque objects

We make `shmop_close()` a NOP, and deprecate the function right away;
detaching from SHM now happens when the wrapper object is freed.

4 years agoClean house in cryptographic hashing code
Alex Dowad [Tue, 23 Jun 2020 14:32:41 +0000 (16:32 +0200)]
Clean house in cryptographic hashing code

- Remove dead code from php_crypt_r.c

  This code has been commented out since the file was added in 2008. It's safe to say
  that no-one is ever going to use it.

- Fix typo in comment in php_crypt_r.c

- Remove redundant Windows-only implementation of php_md5_crypt_r

  There is a portable implementation in the same file, which is selected if not
  building for Windows. But why should Windows have its own special implementation
  of this function at all? There doesn't seem to be any good reason.

  Better to use the portable implementation on all platforms.

- Don't define useless __CONST macro in php_crypt_r.h

  This preprocessor macro is not used anywhere.

- Add comment on functions for encoding data as Base64

- Remove dead code from crypt_blowfish.h

- Remove unneeded junk comments from crypt_freesec.c

- Remove dead code from crypt_blowfish.c

  This function has been commented out since 2011.

4 years agoFix typos in test cases for crypt_sha{256,512}
Alex Dowad [Wed, 24 Jun 2020 11:11:56 +0000 (13:11 +0200)]
Fix typos in test cases for crypt_sha{256,512}

4 years agoRemove unnecessary PHPDoc-alike blocks from tests
Máté Kocsis [Wed, 24 Jun 2020 09:34:14 +0000 (11:34 +0200)]
Remove unnecessary PHPDoc-alike blocks from tests

Closes GH-5759

4 years agoFix potential use-after-scope if crypt_r is used
Nikita Popov [Wed, 24 Jun 2020 11:06:01 +0000 (13:06 +0200)]
Fix potential use-after-scope if crypt_r is used

4 years agoRemove deprecated DES fallback in crypt()
Nikita Popov [Wed, 24 Jun 2020 10:55:37 +0000 (12:55 +0200)]
Remove deprecated DES fallback in crypt()

4 years agoEnforce min/max rounds in sha256/sha512 crypt
Nikita Popov [Wed, 24 Jun 2020 10:41:56 +0000 (12:41 +0200)]
Enforce min/max rounds in sha256/sha512 crypt

This brings our implementation in line with glibc behavior.

4 years agoMerge branch 'PHP-7.4'
Nikita Popov [Wed, 24 Jun 2020 10:22:44 +0000 (12:22 +0200)]
Merge branch 'PHP-7.4'

* PHP-7.4:
  Handle *0 / *1 more consistently

4 years agoHandle *0 / *1 more consistently
Nikita Popov [Wed, 24 Jun 2020 10:20:05 +0000 (12:20 +0200)]
Handle *0 / *1 more consistently

Avoid throwing a DES salt deprecation warning if the libc crypt
implementation is used.

4 years agoFix crypt_r detection
Nikita Popov [Wed, 24 Jun 2020 10:08:31 +0000 (12:08 +0200)]
Fix crypt_r detection

And force use of our own php_crypt_r implementation to keep
previous behavior despite that.

4 years agoProperly initialize displaysize
Christoph M. Becker [Wed, 24 Jun 2020 10:03:13 +0000 (12:03 +0200)]
Properly initialize displaysize

From Microsoft's `SQLColAttribute()` documentation[1]:

| Please note that some drivers may only write the lower 32-bit or
| 16-bit of a buffer and leave the higher-order bit unchanged.
| Therefore, applications should initialize the value to 0 before
| calling this function.

[1] <https://docs.microsoft.com/en-us/sql/odbc/reference/syntax/sqlcolattribute-function>

4 years agoAdd ZEND_ACC_NO_DYNAMIC_PROPERTIES flag to SysvMessageQueue
Máté Kocsis [Wed, 24 Jun 2020 10:04:10 +0000 (12:04 +0200)]
Add ZEND_ACC_NO_DYNAMIC_PROPERTIES flag to SysvMessageQueue

4 years agoAdd flag to forbid dynamic property creation on internal classes
Nikita Popov [Thu, 14 May 2020 09:51:36 +0000 (11:51 +0200)]
Add flag to forbid dynamic property creation on internal classes

While performing resource -> object migrations, we're adding
defensive classes that are final, non-serializable and non-clonable
(unless they are, of course). This path adds a ZEND_ACC_NO_DYNAMIC_PROPERTIES
flag, that also forbids the creation of dynamic properties on these objects.
This is a subset of #3931 and targeted at internal usage only
(though may be extended to userland at some point in the future).

It's already possible to achieve this (what the removed
WeakRef/WeakMap code does), but there's some caveats: First, this
simple approach is only possible if the class has no declared
properties, otherwise it's necessary to special-case those
properties. Second, it's easy to make it overly strict, e.g. by
forbidding isset($obj->prop) as well. And finally, it requires a
lot of boilerplate code for each class.

Closes GH-5572.

4 years agoMerge branch 'PHP-7.4'
Christoph M. Becker [Wed, 24 Jun 2020 09:44:47 +0000 (11:44 +0200)]
Merge branch 'PHP-7.4'

* PHP-7.4:
  Fix potential environment variable deadlock

4 years agoFix potential environment variable deadlock
Christoph M. Becker [Wed, 24 Jun 2020 09:43:04 +0000 (11:43 +0200)]
Fix potential environment variable deadlock

We have to unlock the environment before bailing out.

4 years agoMerge branch 'PHP-7.4'
Christoph M. Becker [Wed, 24 Jun 2020 09:19:17 +0000 (11:19 +0200)]
Merge branch 'PHP-7.4'

* PHP-7.4:
  Fix #69804: ::getStaticPropertyValue() throws on protected props

4 years agoFix #69804: ::getStaticPropertyValue() throws on protected props
Christoph M. Becker [Wed, 15 Apr 2020 13:15:21 +0000 (15:15 +0200)]
Fix #69804: ::getStaticPropertyValue() throws on protected props

`ReflectionClass` allows reading of the values of private and protected
constants, and also to get private and protected static methods.
Therefore getting the values of private and protected static properties
is also permissible, especially since `::getStaticProperties()` already
allows to do so.

We also allow ::setStaticPropertyValue() to modify private and
protected properties, because otherwise this method is useless, as
modifying public properties can be done directly.

4 years agoAdd test case for previous commit
Nikita Popov [Wed, 24 Jun 2020 08:51:51 +0000 (10:51 +0200)]
Add test case for previous commit

Forgot to "git add".

4 years agoFix verify arg jit for references
Nikita Popov [Wed, 24 Jun 2020 08:47:14 +0000 (10:47 +0200)]
Fix verify arg jit for references

4 years agoMark phpdbg test as XFAIL on Windows with JIT enabled
Christoph M. Becker [Wed, 24 Jun 2020 08:33:22 +0000 (10:33 +0200)]
Mark phpdbg test as XFAIL on Windows with JIT enabled

The test fails as of commit 8b12ea04ee405f746ca2394672f8372c57fd05b2.

4 years agoSkip two curl tests under asan
Nikita Popov [Wed, 24 Jun 2020 08:12:37 +0000 (10:12 +0200)]
Skip two curl tests under asan

These tests leak with the curl version on ubuntu 20.04. This should
be fixed when we switch exit to use an exception.

4 years agoMerge branch 'PHP-7.4'
Christoph M. Becker [Wed, 24 Jun 2020 08:07:24 +0000 (10:07 +0200)]
Merge branch 'PHP-7.4'

* PHP-7.4:
  Fix #79487: ::getStaticProperties() ignores property modifications

4 years agoFix #79487: ::getStaticProperties() ignores property modifications
Christoph M. Becker [Wed, 24 Jun 2020 08:03:46 +0000 (10:03 +0200)]
Fix #79487: ::getStaticProperties() ignores property modifications

When retrieving the static class properties via reflection, we have to
cater to possible modifications.

4 years agoInclude stub hash in generated arginfo files
Nikita Popov [Fri, 19 Jun 2020 09:40:31 +0000 (11:40 +0200)]
Include stub hash in generated arginfo files

The hash is used to check whether the arginfo file needs to be
regenerated. PHP-Parser will only be downloaded if this is actually
necessary.

This ensures that release artifacts will never try to regenerate
stubs and thus fetch PHP-Parser, as long as you do not modify any
files.

Closes GH-5739.

4 years agoIncrease failure threshold for 'extensive backtracking' fileinfo test
Alex Dowad [Wed, 24 Jun 2020 06:43:49 +0000 (08:43 +0200)]
Increase failure threshold for 'extensive backtracking' fileinfo test

A spurious failure for this test was seen on Travis CI (S390X):

https://travis-ci.org/github/alexdowad/php-src/jobs/701533828

(The test is expected to finish within 1 second, but it took 1.06 seconds.)
Therefore, increase the threshold a bit.

4 years agoRemove outdated PHPDoc from ext/enchant's stub
Máté Kocsis [Tue, 23 Jun 2020 19:06:36 +0000 (21:06 +0200)]
Remove outdated PHPDoc from ext/enchant's stub

4 years agoImproved JIT for RECV and RECV_INIT instructions
Dmitry Stogov [Tue, 23 Jun 2020 20:21:56 +0000 (23:21 +0300)]
Improved JIT for RECV and RECV_INIT instructions

4 years agoUse standard bool type in EXIF extension
George Peter Banyard [Tue, 23 Jun 2020 18:57:26 +0000 (20:57 +0200)]
Use standard bool type in EXIF extension

4 years agoMerge branch 'PHP-7.4'
Christoph M. Becker [Tue, 23 Jun 2020 17:30:12 +0000 (19:30 +0200)]
Merge branch 'PHP-7.4'

* PHP-7.4:
  Revert "Fix #79487: ::getStaticProperties() ignores property modifications"

4 years agoRevert "Fix #79487: ::getStaticProperties() ignores property modifications"
Christoph M. Becker [Tue, 23 Jun 2020 17:28:51 +0000 (19:28 +0200)]
Revert "Fix #79487: ::getStaticProperties() ignores property modifications"

This reverts commit a895bb6885fbceea3e8375816969d5510d8d082e.

4 years agoMerge branch 'PHP-7.4'
Christoph M. Becker [Tue, 23 Jun 2020 16:52:16 +0000 (18:52 +0200)]
Merge branch 'PHP-7.4'

* PHP-7.4:
  Fix #79487: ::getStaticProperties() ignores property modifications

4 years agoFix #79487: ::getStaticProperties() ignores property modifications
Christoph M. Becker [Tue, 23 Jun 2020 16:34:07 +0000 (18:34 +0200)]
Fix #79487: ::getStaticProperties() ignores property modifications

When retrieving the static class properties via reflection, we have to
cater to possible modifications.

4 years agoDeprecate the procedural API of ext/zip
Máté Kocsis [Sat, 20 Jun 2020 07:50:09 +0000 (09:50 +0200)]
Deprecate the procedural API of ext/zip

Closes GH-5746

4 years agoReplace exceptional code by side exit to VM
Dmitry Stogov [Tue, 23 Jun 2020 15:31:42 +0000 (18:31 +0300)]
Replace exceptional code by side exit to VM

4 years agoCleanup and better register usage
Dmitry Stogov [Tue, 23 Jun 2020 14:51:02 +0000 (17:51 +0300)]
Cleanup and better register usage

4 years agoReduce amount of "cold" code generated for FETCH_OBJ_* instructions
Dmitry Stogov [Tue, 23 Jun 2020 14:16:44 +0000 (17:16 +0300)]
Reduce amount of "cold" code generated for FETCH_OBJ_* instructions

4 years agoSimplify `_crypt_extended_init_r`, and fix redundant initialization on Win32/Solaris
Alex Dowad [Wed, 27 May 2020 04:01:22 +0000 (06:01 +0200)]
Simplify `_crypt_extended_init_r`, and fix redundant initialization on Win32/Solaris

Looking at the history of this function, the original implementation had a bug where
it would return from the middle of the function without unlocking the mutex first.
The author attempted to fix this by incrementing the `initialized` flag atomically,
which is not necessary, since the section which modifies the flag is protected by a
mutex.

Coincidentally, at the same time that all this unnecessary 'atomic' machinery was
introduced, the code was also changed so that it didn't return without unlocking the
mutex. So it looks like the bug was fixed by accident.

It's not necessary to declare the flag as `volatile` either, since it is protected
by a mutex.

Further, the 'fixed' implementation was also wrong in another respect: on Windows
and Solaris, the `initialized` flag was not even declared as `static`!! So the
initialization of the static tables for S-boxes, P-boxes, etc. was repeated on
each call to `php_crypt`, completely defeating the purpose of this function.

4 years agoMerge branch 'PHP-7.4'
Christoph M. Becker [Tue, 23 Jun 2020 14:02:19 +0000 (16:02 +0200)]
Merge branch 'PHP-7.4'

* PHP-7.4:
  Fix #55857: ftp_size on large files