1
0
mirror of https://github.com/php/php-src.git synced 2026-04-28 18:53:33 +02:00
Commit Graph

1301 Commits

Author SHA1 Message Date
Nikita Popov 597a5da027 Support computing func info from ret arg info for internal funcs 2019-09-03 10:32:47 +02:00
Nikita Popov 3cca014ce4 Remove duplicate func info for array_key_first/last
Looks like this was already added in master separately...
2019-09-03 10:31:39 +02:00
Nikita Popov d4a7d17b9a Merge branch 'PHP-7.4' 2019-09-03 09:58:29 +02:00
Tyson Andre 4de8503c22 Add missing opcache return info for ext/standard.
array_key_first/last returns null for invalid args,
wrong argument counts, and empty arrays.

random_bytes returns a string or throws.
2019-09-03 09:57:51 +02:00
Nikita Popov d440a3cddb Merge branch 'PHP-7.4' 2019-09-03 09:53:51 +02:00
Tyson Andre 1a905bcb1e Add new missing functions from ext/hash 2019-09-03 09:53:41 +02:00
Tyson Andre 149588280b Fix opcache optimizer info for time_nanosleep (again)
Fixes my earlier PR #4617

If I remember correctly,
The F0 macro is used for return values that are guaranteed to not be
reference counted.
The F1 macro is used for return values that may have up to 1 reference
(i.e. MAY_BE_RC1).

I didn't notice that time_nanosleep needed to be F1 since it could
return an array, and that array is reference counted.
2019-09-03 09:31:01 +02:00
Nikita Popov 7f78f839dc php_stream_from_zval can no longer return false 2019-09-03 09:25:50 +02:00
Nikita Popov 3ac0f42c40 Merge branch 'PHP-7.4' 2019-09-03 09:24:20 +02:00
Nikita Popov 632708ac02 Merge branch 'PHP-7.3' into PHP-7.4 2019-09-03 09:24:05 +02:00
Nikita Popov d66e0f165d Merge branch 'PHP-7.2' into PHP-7.3 2019-09-03 09:23:55 +02:00
Tyson Andre 9c3b7ccda5 Fix opcache return type for hash_update_stream
It can return false if the resource type is wrong.

```
php > var_export(hash_update_stream(hash_init('md5'),
        imagecreate(1,1)));

Warning: hash_update_stream(): supplied resource is not a valid stream
resource in php shell code on line 1
false
```

The return types were initially added in
c88ffa9a56
2019-09-03 09:23:39 +02:00
Dmitry Stogov 0581508ba4 Fixed pow() function info 2019-09-02 21:44:10 +03:00
Nikita Popov 69cf535261 Fix func info for chop()
chop() is an alias of rtrim() and may return copied strings, so
should use FN.
2019-08-30 11:18:47 +02:00
Nikita Popov 774cdb1d59 Merge branch 'PHP-7.3' into PHP-7.4 2019-08-26 11:13:57 +02:00
Nikita Popov e4ecadcb62 Merge branch 'PHP-7.2' into PHP-7.3 2019-08-26 11:13:49 +02:00
Tyson Andre 1e82a2d659 Also fix signature for passthru
Backported from a1a8d14485
https://www.php.net/manual/en/function.passthru.php#refsect1-function.passthru-returnvalues

`passthru()` is false with invalid args
`passthru('command')` is null.
2019-08-26 11:13:26 +02:00
Tyson Andre f5bccc0eb5 Fix opcache optimizer info for time_nanosleep
This can also return an array. See
https://www.php.net/manual/en/function.time-nanosleep.php#refsect1-function.time-nanosleep-returnvalues

> If the delay was interrupted by a signal, an associative array will be
returned with the components:
>
> - seconds - number of seconds remaining in the delay
> - nanoseconds - number of nanoseconds remaining in the delay

Sending a SIGUSR1 to the below program would trigger this behavior.

```
pcntl_signal(\SIGUSR1, function ($signo, $signinfo) {
    echo "Handling a signal $signo\n";
});
echo "Sleeping for 100 seconds\n";
var_export(time_nanosleep(100, 0));
```

The incomplete signature existed since c88ffa9a5.
No phpt tests existed for time_nanosleep returning an array
2019-08-26 11:13:26 +02:00
Tyson Andre 50be2ecbd7 Fix opcache type info for stream_bucket_make_writable()
Closes GH-4567.
2019-08-20 16:21:53 +02:00
Nikita Popov a33361a37c Merge branch 'PHP-7.2' into PHP-7.3 2019-08-13 11:22:41 +02:00
Nikita Popov 4eeb41d1ea Fixed bug #77191 2019-08-13 11:19:58 +02:00
Nikita Popov e63093e547 Merge branch 'PHP-7.4' 2019-08-01 10:11:02 +02:00
Nikita Popov afd96392a3 Revert "Use RW fetch for argument unpacking"
This reverts commit 6913ec3282.
This reverts commit a9e332e027.

Causes https://bugs.php.net/bug.php?id=78356, which I don't have
a good solution for.
2019-08-01 10:06:53 +02:00
Nikita Popov a4cfbeb143 Merge branch 'PHP-7.4' 2019-07-30 10:32:26 +02:00
Nikita Popov a9e332e027 Handle RW UNPACK in inference 2019-07-30 10:31:51 +02:00
Nikita Popov 45eabeca81 Merge branch 'PHP-7.4' 2019-07-29 13:03:59 +02:00
Nikita Popov a22a06c351 Merge branch 'PHP-7.3' into PHP-7.4 2019-07-29 13:03:53 +02:00
Nikita Popov 8e63bb5e46 Fixed bug #78341
The smart branch logic assumed b->start refers to the old offsets,
while b->start was already adjusted to the new offsets at this
point. Delay the change until later.
2019-07-29 13:02:01 +02:00
Dmitry Stogov 97912023bb Merge branch 'PHP-7.4'
* PHP-7.4:
  Use run-time cache to avoid repeatable hash lookups in ZEND_DECLARE_CLASS_DELAYED
2019-07-19 11:46:35 +03:00
Dmitry Stogov 445d51347d Use run-time cache to avoid repeatable hash lookups in ZEND_DECLARE_CLASS_DELAYED 2019-07-19 11:46:03 +03:00
Dmitry Stogov a837b80a48 Merge branch 'PHP-7.4'
* PHP-7.4:
  Use run-time cache to avoid repeatable hash lookups when creating anonymous functions and classes
2019-07-19 10:45:00 +03:00
Dmitry Stogov d5943f5a11 Use run-time cache to avoid repeatable hash lookups when creating anonymous functions and classes 2019-07-19 10:43:49 +03:00
Dmitry Stogov 5ac3580b9b Merge branch 'PHP-7.4'
* PHP-7.4:
  ZEND_DECLARE_ANON_CLASS doesn't need to skip anything now. It's immediatelly followed by ZEND_NEW.
2019-07-19 10:10:50 +03:00
Dmitry Stogov b065fbde19 ZEND_DECLARE_ANON_CLASS doesn't need to skip anything now. It's immediatelly followed by ZEND_NEW. 2019-07-19 10:09:26 +03:00
Nikita Popov df84d680bf Merge branch 'PHP-7.4' 2019-07-10 17:28:52 +02:00
Nikita Popov a54ee8a947 Merge branch 'PHP-7.3' into PHP-7.4 2019-07-10 17:28:37 +02:00
Nikita Popov e7a83ec8df Fix bug #78271
When cleaning nops in the dfa pass, we were always keeping the
smart branch inhibiting nop that occurs directly before the jump
instruction. However, as we skip unreachable blocks entirely, it
may happen that we need to keep a nop that occurs further back,
prior to the unreachable blocks. Account for that case now.

We should really do something about the smart branch situation,
this is very fragile...
2019-07-10 17:25:40 +02:00
Nikita Popov e3c701ea38 Merge branch 'PHP-7.2' into PHP-7.3 2019-07-05 12:07:10 +02:00
Nikita Popov 5846e85283 Backport fe_reset_rw case 2019-07-05 12:06:52 +02:00
Nikita Popov a92e6d7136 Merge branch 'PHP-7.4' 2019-07-05 12:05:10 +02:00
Nikita Popov 73fd2da754 Make sure all cases of fetch_dim_w adjustment are handled
Use EMPTY_SWITCH_DEFAULT_CASE() to trigger an assertion in case
we miss something.

Add missing FE_RESET_RW case.
2019-07-05 12:02:26 +02:00
Nikita Popov 8ae9e1b9a2 Merge branch 'PHP-7.4' 2019-07-05 11:43:26 +02:00
Nikita Popov 1086198711 Merge branch 'PHP-7.3' into PHP-7.4 2019-07-05 11:41:57 +02:00
Nikita Popov 920283ff2b Merge branch 'PHP-7.2' into PHP-7.3 2019-07-05 11:40:45 +02:00
Nikita Popov c353f17d42 Fix inference for compound object op on dim 2019-07-05 11:39:42 +02:00
Dmitry Stogov 1b5b8175af Merge branch 'PHP-7.4'
* PHP-7.4:
  Replace ZEND_ASSIGN_ADD (and others) by ZEND_ASSIGN_OP, ZEND_ASSIGN_DIM_OP, ZEND_ASSGIN_OBJ_OP and ZEND_ASSIGN_STATIC_PROP_OP
2019-07-05 12:16:30 +03:00
Dmitry Stogov 48ca5a1e17 Replace ZEND_ASSIGN_ADD (and others) by ZEND_ASSIGN_OP, ZEND_ASSIGN_DIM_OP, ZEND_ASSGIN_OBJ_OP and ZEND_ASSIGN_STATIC_PROP_OP 2019-07-05 12:03:25 +03:00
Nikita Popov 9fbf9e3e13 Merge branch 'PHP-7.4' 2019-07-04 17:13:04 +02:00
Nikita Popov a0e7624059 Compact literals: Don't insert unmergeable keys
LITERAL_VALUE with related literals cannot be merged, avoid inserting
them in the literals hash in the first place. Otherwise we may end up
inserting the same key multiple times. We may also miss merging
opportunities due to the duplicate keys.
2019-07-04 17:12:55 +02:00
Nikita Popov fa1a03f7a2 Merge branch 'PHP-7.4' 2019-07-03 10:22:41 +02:00