Commit Graph

125605 Commits

Author SHA1 Message Date
Máté Kocsis
ea9f943d33
Change gen-stub.php to gen_stub.php in help text 2021-09-12 17:09:56 +02:00
Máté Kocsis
73063db5c8
Fix documentation generation when legacy arginfo is generated
When legacy arginfo is generated, all the type info gets lost. Since this task is performed before any other additional functionalities of gen_stub.php (e.g. verification, method synopsis and class synopsis generation), these fail as they would require the missing type information.

The issue is fixed by deep cloning the file info objects (albeit only their affected properties), so that we use those for legacy arginfo generation, leaving the original ones untouched.
2021-09-12 11:42:22 +02:00
Remi Collet
6ee96f095a
fix [-Wmaybe-uninitialized] build warnings 2021-09-10 15:57:56 +02:00
Nikita Popov
f6daf83e75 Merge branch 'PHP-8.0' into PHP-8.1
* PHP-8.0:
  Check that POST_INC/DEC has use in DFA optimization
2021-09-09 15:50:04 +02:00
Nikita Popov
5cae6b9b0d Check that POST_INC/DEC has use in DFA optimization
We'd have usually converted it into a PRE_INC if there is no use,
but that's not guaranteed. If there is no use at this point, make
sure we don't try to use the sentinel value.
2021-09-09 15:48:51 +02:00
Nikita Popov
f86a963199 Merge branch 'PHP-8.0' into PHP-8.1
* PHP-8.0:
  Also make sure binary op operands can't be undef
2021-09-09 15:09:02 +02:00
Nikita Popov
8c3d33a054 Also make sure binary op operands can't be undef
Otherwise we will end up passing undef to xyz_function etc, which
is not permitted.
2021-09-09 15:08:08 +02:00
Nikita Popov
b9a6ec2097 Merge branch 'PHP-8.0' into PHP-8.1
* PHP-8.0:
  Check whether expected types are present for compound op jit
2021-09-09 14:33:10 +02:00
Nikita Popov
bac054dbf3 Check whether expected types are present for compound op jit
zend_jit_long_math_helper() implicitly assumes that the operands
MAY_BE_LONG (but can also have additional types). It will normally
only be called if this is guaranteed. However, for compound
array/object assignment ops this was not check. Generalize the
existing check for assign_op to apply to these as well.

Of course, we could also make the code support this correctly,
but I don't think it makes sense to JIT these if the type we're
specializing for is not present.

Closes GH-7481.
2021-09-09 14:32:14 +02:00
Dmitry Stogov
679bfb1522 Merge branch 'PHP-8.0' into PHP-8.1
* PHP-8.0:
  JIT: fixed MUL+SEND optimization when MUL throws an exception
2021-09-08 17:57:21 +03:00
Dmitry Stogov
06275d940c JIT: fixed MUL+SEND optimization when MUL throws an exception 2021-09-08 17:53:23 +03:00
Nikita Popov
f2bb739eeb Apply fix to ARM JIT as well
This is the same change as e22fb46127,
but for the ARM JIT implementation.
2021-09-08 15:46:35 +02:00
Nikita Popov
4bccf36973 Merge branch 'PHP-8.0' into PHP-8.1
* PHP-8.0:
  Save register before throwing undef var notice
2021-09-08 14:46:08 +02:00
Nikita Popov
e22fb46127 Save register before throwing undef var notice
Otherwise we may clobber it while throwing the undef var notice.
This makes the implementation for assign_dim_op line up with
fetch_dim.
2021-09-08 14:45:49 +02:00
George Peter Banyard
be2500f229
Merge branch 'PHP-8.0' into PHP-8.1
* PHP-8.0:
  Fix param name order for Phar::copy()
2021-09-08 12:32:58 +01:00
George Peter Banyard
0d0c9acafb
Fix param name order for Phar::copy() 2021-09-08 12:31:09 +01:00
Nikita Popov
8d069d266a Merge branch 'PHP-8.0' into PHP-8.1
* PHP-8.0:
  Fix jump after zend_jit_invalid_property_assign()
2021-09-08 12:29:05 +02:00
Nikita Popov
b0e16f0e4f Fix jump after zend_jit_invalid_property_assign()
This is supposed to go to the FREE_OP_DATA, currently it crashes.
2021-09-08 12:27:54 +02:00
Máté Kocsis
a5e5483439
Remove extra space before param default values 2021-09-08 12:24:47 +02:00
Máté Kocsis
4c9892d1e3
Fix class synopsis generation for interfaces
We have to generate <ooclass> elements for interfaces (rather than <oointerface>) in a number of places: directly inside the <classsynopsis> element and in the extends list.
2021-09-08 12:23:00 +02:00
Nikita Popov
f5cce2b167 Merge branch 'PHP-8.0' into PHP-8.1
* PHP-8.0:
  Don't overwrite unwind exception
2021-09-08 11:04:40 +02:00
Nikita Popov
85b80c5aaf Don't overwrite unwind exception
When killing a coroutine by throwing an unwind exit into it during
an I/O operation, the I/O failure may result in an exception being
thrown, which will replace the unwind exit exception and the
coroutine will ultimately not exit. This patch avoids this by
ignoring the newly thrown exception and keeping the unwind exit
exception.

Closes GH-7459.
2021-09-08 11:04:12 +02:00
Máté Kocsis
f588764292
Improve class synopsis root element generation
Besides classrefs, we also have exceptionrefs. Also, the 4th capture group replacement used to be unintentionally duplicated.
2021-09-08 10:40:14 +02:00
Derick Rethans
6dd2630ebd Merge branch 'PHP-8.0' into PHP-8.1 2021-09-07 17:28:32 +01:00
Derick Rethans
c87f405084 Merge branch 'PHP-7.4' into PHP-8.0 2021-09-07 17:28:22 +01:00
Derick Rethans
95a943e2f0 The PHP 7.4 branch is for PHP 7.4.25 now 2021-09-07 17:28:16 +01:00
Sara Golemon
8670111846 Merge branch 'PHP-8.0' into PHP-8.1
* PHP-8.0:
  Prep for 8.0.12
2021-09-07 15:18:23 +00:00
Sara Golemon
5e1e4a8963
Prep for 8.0.12 2021-09-07 15:16:11 +00:00
Dmitry Stogov
487eface86 Fixed ARM JIT failure introduced in d4ed6b635f 2021-09-07 17:18:35 +03:00
Dmitry Stogov
7fcb45dffa JIT: prefer string reallocation instead of allocation/memcpy/deallocation 2021-09-07 15:28:15 +03:00
Dmitry Stogov
aed94e2ca8 JIT: improved code for protected properties access 2021-09-07 13:18:14 +03:00
Dmitry Stogov
1bb6cf5396 JIT: eliminate check for undefined constant if there is a persistent constant 2021-09-07 13:17:16 +03:00
Dmitry Stogov
d4ed6b635f JIT: Update run_time_cache slot in zend_jit_find_func helper 2021-09-07 13:13:47 +03:00
Máté Kocsis
c8f858ef49
Add more specific array return type hints for various extensions - part 4 (#7469) 2021-09-06 17:14:52 +02:00
Máté Kocsis
6a47831e6e
Add more specific array return type hints for various extensions - part 3 (#7467) 2021-09-06 12:27:28 +02:00
Máté Kocsis
a55c6384dc
Merge branch 'PHP-8.0' into PHP-8.1
* PHP-8.0:
  Fix the return type of ftp_raw()
2021-09-06 10:29:24 +02:00
Máté Kocsis
4b3206d6c1
Fix the return type of ftp_raw() (#7466) 2021-09-06 10:26:01 +02:00
Máté Kocsis
d670d9335c
Merge branch 'PHP-8.0' into PHP-8.1
* PHP-8.0:
  Fix default value of $flags in idn_to_ascii() and idn_to_utf8()
2021-09-04 17:57:23 +02:00
Máté Kocsis
d5aed7b0e3
Fix default value of $flags in idn_to_ascii() and idn_to_utf8() 2021-09-04 16:42:28 +02:00
Derick Rethans
a6d50d21d9 Fixed typo 2021-09-03 18:21:10 +01:00
Tyson Andre
4c48fd22d7
Fix inconsistency in true/false/null constant resolution when opcache is not used (#7441)
Strangely, uses of eval and 'php -a' (or loading a file without opcache after a namespaced constant was declared)
will not treat non-FQ true/false/null as magic keywords, while compiled php required from a file would do that.

This may confuse people learning the language, and result in code loaded with
eval() behaving differently from the same snippet in a file loaded by require.

```
Interactive shell

php > define('foo\true', 'test');
php > namespace foo { var_dump(true); }
string(4) "test"
```

This will make the same session instead properly emit `bool(true);` like it
already would if running those statements in files when opcache was used.
2021-09-03 08:42:36 -04:00
Nikita Popov
3eeeeeb104 Fully qualify ReturnTypeWillChange in deprecation message
When adding the #[ReturnTypeWillChange] attribute in namespaced
code, you also need to use ReturnTypeWillChange, otherwise it
will be silently ignored and may result in confusion. Change the
deprecation message to suggest #[\ReturnTypeWillChange], which
will always work.

Closes GH-7454.
2021-09-03 13:57:23 +02:00
Christoph M. Becker
cb5a4ed920
Use --EXTENSIONS-- section for new test 2021-09-02 23:49:05 +02:00
Christoph M. Becker
404bed1a69
Merge branch 'PHP-8.0' into PHP-8.1
* PHP-8.0:
  Fix #81407: shmop_open won't attach and causes php to crash
2021-09-02 23:21:22 +02:00
Christoph M. Becker
58ad403cec
Merge branch 'PHP-7.4' into PHP-8.0
* PHP-7.4:
  Fix #81407: shmop_open won't attach and causes php to crash
2021-09-02 23:18:53 +02:00
Christoph M. Becker
f3d24af74f
Fix #81407: shmop_open won't attach and causes php to crash
We need to allocate buffers for the file mapping names which are large
enough for all potential keys (`key_t` is defined as `int` on Windows).

Regarding the test: it's probably never a good idea to use hard-coded
keys (should always use `ftok()` instead), but to reliably reproduce
this Windows specific issue we need to, and it shouldn't be an issue on
that OS.

Closes GH-7448.
2021-09-02 23:16:48 +02:00
Máté Kocsis
805f2b9803
Fix forgotten test 2021-09-02 17:44:52 +02:00
Máté Kocsis
194f1f095f
Revert unintended tentative return type change
I accidentally made the return type of all Reflection*::getAttributes() methods tentative, even though they have already been declared natively.
2021-09-02 17:06:19 +02:00
Máté Kocsis
4483ecf5a9
Properly escape the default value of string properties and enum cases 2021-09-02 16:53:31 +02:00
Dmitry Stogov
cbc925e510 Fixed bug #81409 (Incorrect JIT code for ADD with a reference to array) 2021-09-02 11:13:27 +03:00