Commit Graph

120247 Commits

Author SHA1 Message Date
Dmitry Stogov
2369f48092 Infer information about packed/hash arrays and use it for JIT 2020-08-25 18:28:23 +03:00
Nikita Popov
647fb38d58 Ensure RuleBasedBreakIterator constructor throws on failure
Constructors must throw on failure indepdendent of the configured
intl error mode.
2020-08-25 15:28:58 +02:00
Máté Kocsis
6c8fb123d2
Promote warnings to exceptions in ext/simplexml
Closes GH-6011

Co-authored-by: Nikita Popov <nikita.ppv@gmail.com>
2020-08-25 15:15:58 +02:00
Dmitry Stogov
f77200f5c6 Fixed JIT failure on "$a = []; $a[1] += 2;" 2020-08-25 16:08:33 +03:00
Christoph M. Becker
7e5ed818a4 Merge branch 'PHP-7.4' into master
* PHP-7.4:
  Avoid double-free
2020-08-25 13:15:06 +02:00
Christoph M. Becker
923a14626c Merge branch 'PHP-7.3' into PHP-7.4
* PHP-7.3:
  Avoid double-free
2020-08-25 13:12:41 +02:00
Nikita Popov
259d050a39 Clean up BreakIterator create_object handler
Use standard zend_object_alloc() function and fix the
object_init_properties() call (which works out okay because there
are no properties).
2020-08-25 13:11:43 +02:00
Nikita Popov
5ecefd0760 Fix XMLWriter::writeDtdEntity() stub
$isparam is optional.
2020-08-25 13:11:43 +02:00
Christoph M. Becker
3324bb893e Avoid double-free
As of commit b2e3fd1[1] the `authid.User` is no longer newly allocated,
so we must not free it.

[1] <http://git.php.net/?p=php-src.git;a=commit;h=b2e3fd1e691b1dc82aaaf4150461db97bd5acf4a>
2020-08-25 13:11:22 +02:00
Máté Kocsis
d54bc29540
Promote warnings to exceptions in ext/shmop
Closes GH-5986
2020-08-25 13:09:23 +02:00
Máté Kocsis
3df306de94
Promote warnings to exceptions in ext/pcntl
Closes GH-6004
2020-08-25 13:02:13 +02:00
Nikita Popov
4a98b64413 Merge branch 'PHP-7.4'
* PHP-7.4:
  Remove bogus REGISTER_LONG_CONSTANT
2020-08-25 12:36:06 +02:00
Nikita Popov
86e7aa20ad Merge branch 'PHP-7.3' into PHP-7.4
* PHP-7.3:
  Remove bogus REGISTER_LONG_CONSTANT
2020-08-25 12:35:54 +02:00
Nikita Popov
063082043a Remove bogus REGISTER_LONG_CONSTANT
This shouldn't be in this function, probably a copy/paste mistake...
2020-08-25 12:35:38 +02:00
twosee
9f05c32704 Remove useless same_zval function
Closes GH-6039.
2020-08-25 18:02:38 +08:00
Máté Kocsis
be5ba20132
Promote warnings to exceptions in ext/phar
Closes GH-6008
2020-08-25 11:57:37 +02:00
Máté Kocsis
f068fbcf1f
Promote warnings to exceptions in ext/xmlreader
Closes GH-6021
2020-08-25 11:54:45 +02:00
Nikita Popov
f4e9d0e325 Don't return temporary from SXE write_property handler
Return the original value. If we don't return the original value,
we need to own the zval, which we don't.

For clarity also switch things to work on a zend_string* value
instead of a zval*.
2020-08-25 11:28:44 +02:00
Nikita Popov
afde6dcf5f Simplify change_node_zval implementation
At this point, the value has already been converted into a string.
2020-08-25 11:01:48 +02:00
Dmitry Stogov
d384537859 Move AVOID_REFCOUNTING type info flag into a separate bit 2020-08-25 11:37:30 +03:00
Christoph M. Becker
ecf4e7063d Merge branch 'PHP-7.4' into master
* PHP-7.4:
  Fix potential integer overflow detected by oss-fuzz
2020-08-24 17:38:50 +02:00
Máté Kocsis
1fb66b8114
Promote warning to exception in ext/enchant
Closes GH-6022
2020-08-24 17:37:20 +02:00
Christoph M. Becker
5dd1877ca1 Merge branch 'PHP-7.3' into PHP-7.4
* PHP-7.3:
  Fix potential integer overflow detected by oss-fuzz
2020-08-24 17:36:50 +02:00
Christoph M. Becker
74de17f2ea Fix potential integer overflow detected by oss-fuzz
We port the respective fix from upstream[1].

[1] <9ed642764c>
2020-08-24 17:35:04 +02:00
Máté Kocsis
ffff237497
Promote warning to exception in ext/posix
Closes GH-6009
2020-08-24 17:34:33 +02:00
Máté Kocsis
cc35cfd2eb
Promote warnings to exceptions in ext/filter
Closes GH-5970
2020-08-24 17:34:32 +02:00
Nikita Popov
c557c410af Drop a spurious zend_string_release
This should have been dropped in the refactoring.
2020-08-24 17:30:31 +02:00
Nikita Popov
9feb98859f Clean up setlocale implementation
Factor out the core logic into a separate function and drop the
"clever" code that combines iteration through variadic arguments
and arrays.

This fixes bug #79829 as a side effect.
2020-08-24 17:09:33 +02:00
Nikita Popov
8c3574bd6c Remove php_my_setlocale workaround
This works around a macro-expansion issue that is no longer
relevant in PHP 8.
2020-08-24 16:50:03 +02:00
Nikita Popov
7a6ae9b148 Fix refcounting for the named params case as well
Adjust the test case to pass a refcounted value and to also check
the named params case.
2020-08-24 16:30:49 +02:00
Nikita Popov
779e904465 Merge branch 'PHP-7.4'
* PHP-7.4:
  Fix refcounting
2020-08-24 16:23:33 +02:00
Nikita Popov
bb54694f4f Fix refcounting 2020-08-24 16:23:19 +02:00
Tyson Andre
e056e2dae9 Check for duplicate names in gen_stub.php
With named arguments in php 8.0, it's important that php's modules
or PECL extensions using gen_stub.php don't generate functions
with duplicate names.

Warn if a parameter name is repeated,
even if the last occurrence is a variadic parameter

Closes GH-6035
2020-08-24 09:31:46 -04:00
Christoph M. Becker
5643f34a1e Merge branch 'PHP-7.4' into master
* PHP-7.4:
  Fix #79979: passing value to by-ref param via CUFA crashes
2020-08-24 15:03:26 +02:00
Christoph M. Becker
6b6c2c003c Fix #79979: passing value to by-ref param via CUFA crashes
If a by-val send is not allowed, we must not do so.  Instead we wrap
the value in a temporary reference.

Closes GH-6000
2020-08-24 14:08:32 +02:00
Berbe
bfeb2f6abc Fix: Gracefully handle empty user input in run-tests.php
Closes GH-6016.
2020-08-24 11:46:01 +02:00
David Carlier
32c6a0bbbb further network libraries detection for Haiku system.
Closes GH-5997.
2020-08-24 11:37:48 +02:00
Christoph M. Becker
c925028d49 Merge branch 'PHP-7.4' into master
* PHP-7.4:
  Fix #79986: str_ireplace bug with diacritics characters
2020-08-24 11:10:09 +02:00
Christoph M. Becker
5ab7b30cd6 Merge branch 'PHP-7.3' into PHP-7.4
* PHP-7.3:
  Fix #79986: str_ireplace bug with diacritics characters
2020-08-24 11:09:38 +02:00
Christoph M. Becker
844a2dd6ac Fix #79986: str_ireplace bug with diacritics characters
`tolower()` returns an `int`, so we must not convert to `char` which
may be `signed` and as such may be subject to overflow (actually,
implementation defined behavior).

Closes GH-6007
2020-08-24 11:08:48 +02:00
Christoph M. Becker
08d2e511e4 Merge branch 'PHP-7.4' into master
* PHP-7.4:
  Fix #80002: calc free space for new interned string is wrong
2020-08-24 11:04:27 +02:00
Christoph M. Becker
10df94dd0e Merge branch 'PHP-7.3' into PHP-7.4
* PHP-7.3:
  Fix #80002: calc free space for new interned string is wrong
2020-08-24 11:04:03 +02:00
Christoph M. Becker
fcd26ffcc3 Fix #80002: calc free space for new interned string is wrong
We need to calculate the free size in bytes.

Patch contributed by t-matsuno.

Closes GH-6024
2020-08-24 11:03:19 +02:00
Nikita Popov
9395e01e3d Check variadic parameter for type and duplicate name
Set HAS_TYPE_HINTS flag if the variadic parameter is types as well,
and make sure it has a distinct name. This was previously missed,
because the variadic parameter is not part of num_args.
2020-08-24 10:15:57 +02:00
Kees Cook
2c2bb50984 sapi/fpm/config.m4: check for libapparmor's aa_change_profile()
The fpm code actually uses aa_change_profile(), not change_hat(). Test
for the correct function. (libapparmor always has both, so this is just
a correctness fix.)

Closes GH-6037.
2020-08-24 10:10:12 +02:00
Dmitry Stogov
5c18ee58b9 Fixed use-after-free introduced by aed1f78515 2020-08-24 09:50:54 +03:00
Máté Kocsis
118406a31c
Remove custom hacks from gen_stub.php after PHP-Parser upgrade 2020-08-23 21:17:05 +02:00
Tyson Andre
4bba59d491 Update PHP-Parser from 4.3.0 to 4.9.0
PHP-Parser 4.3.0 failed to recognize that the `match` keyword could be
used as a class constant name.
4.9.0 also adds support for keywords in namespaced names.
See https://github.com/nikic/PHP-Parser/releases

So forcing regeneration of spl_iterators.stub.php failed.

PECL extensions using gen_stub.php would also be affected
by the same issue.

```
ext/spl/spl_iterators.stub.php
    public function __construct(Iterator $iterator, string $regex,
    int $mode = self::MATCH, int $flags = 0, int $preg_flags = 0) {}
```

Testing: I successfully regenerated stubs by setting forceRegeneration to true
and running `touch **/*.stub.php; make`.
The stubs did not change, as expected.

Closes GH-6036
2020-08-23 11:51:57 -04:00
Christoph M. Becker
e6044d4455 Fix #55847: DOTNET .NET 4.0 GAC new location
If we do not specify the exact version of the .NET framework to use,
the default CLR is loaded, which is typically CLR 2, which is very old.
Therefore, we introduce a `PHP_INI_SYSTEM` setting, which allows users
to choose the desired .NET framework version.  The value of the setting
are the first three parts of the framework's version number, separated
by dots, and prefixed with "v", e.g. "v4.0.30319".  If the value of the
INI setting is `NULL` (the default) or an empty string, the default CLR
is used.

Internally, we switch from the most generic `CoCreateInstance()` to
`CorBindToRuntime()` which is implemented in mscoree.dll.  To avoid the
hard dependency to that library, we load dynamically.

So this fix is supposed to be fully backwards compatible.

Closes GH-5949
2020-08-22 12:42:34 +02:00
Christoph M. Becker
969a432fd8 Merge branch 'PHP-7.4' into master
* PHP-7.4:
  Fix #80007: Potential type confusion in unixtojd() parameter parsing
2020-08-22 12:34:24 +02:00