Commit Graph

2584 Commits

Author SHA1 Message Date
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
24b1c2447c JIT: Fix missing free on JMPZ_EX with op1 == res
We need to free the operand before we overwrite it with the result.
2019-08-30 14:50:22 +02:00
Nikita Popov
65fa6dac19 Add jit_bisect_limit
To help identify which function is being miscompiled.
2019-08-30 14:50:22 +02: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
8239b58bea Fix closure extra args freeing for JIT as well 2019-08-30 10:35:41 +02:00
Christoph M. Becker
0ab4fca8e3 Add ext\opcache stubs 2019-08-26 16:05:01 +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
George Peter Banyard
1059e3dc39 Promote warnings to errors in str_repeat() 2019-08-23 20:01:19 +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
19378ae44a Merge branch 'PHP-7.4' 2019-08-13 11:23:35 +02:00
Nikita Popov
76fecb339f Merge branch 'PHP-7.3' into PHP-7.4 2019-08-13 11:23:06 +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
Dmitry Stogov
f64650408a Merge branch 'PHP-7.4'
* PHP-7.4:
  typo
2019-08-06 13:58:29 +03:00
Dmitry Stogov
ef35556498 typo 2019-08-06 13:58:17 +03:00
Dmitry Stogov
e2440c3da5 Merge branch 'PHP-7.4'
* PHP-7.4:
  Preloading is not comatible with dl() function
2019-08-06 12:45:48 +03:00
Dmitry Stogov
d5d76ea6e7 Preloading is not comatible with dl() function 2019-08-06 12:44:55 +03:00
Dmitry Stogov
d6a8a5ac64 Merge branch 'PHP-7.4'
* PHP-7.4:
  Fixed bug #78376 (Incorrect preloading of constant static properties)
2019-08-05 22:56:03 +03:00
Dmitry Stogov
3fc0e2bb80 Fixed bug #78376 (Incorrect preloading of constant static properties) 2019-08-05 22:55:06 +03:00
Nikita Popov
21cd438c33 Merge branch 'PHP-7.4' 2019-08-01 17:00:49 +02:00
Nikita Popov
bf53d30fae Fix forwarding of extra args in opcache server tests 2019-08-01 17:00:11 +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
Christoph M. Becker
7548421202 Merge branch 'PHP-7.4'
* PHP-7.4:
  Fix build for --disable-signals
2019-07-29 18:50:13 +02:00
Christoph M. Becker
3429370d69 Fix build for --disable-signals 2019-07-29 18:49:44 +02:00
Nikita Popov
9a3aef3c21 Merge branch 'PHP-7.4' 2019-07-29 17:15:35 +02:00
Nikita Popov
6df1665bb3 Merge branch 'PHP-7.3' into PHP-7.4 2019-07-29 17:14:40 +02:00
Nikita Popov
bbed5564eb Merge branch 'PHP-7.2' into PHP-7.3 2019-07-29 16:57:57 +02:00
Nikita Popov
38f1288b64 Fix Zend signals unblocking
There are a few parts here:
 * opcache should not be blocking signals while invoking compile_file,
   otherwise signals may remain blocked on a compile error. While at
   it, also protect SHM memory during compile_file.
 * We should deactivate Zend signals at the end of the request, to make
   sure that we gracefully recover from a missing unblock and signals
   don't remain blocked forever.
 * We don't use a critical section in deactivation, because it should
   not be necessary. Additionally we want to clean up the signal queue,
   if it is non-empty.
 * Enable SIGG(check) in debug builds so we notice issues in the future.
2019-07-29 15:17:32 +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
Nikita Popov
36db71df47 Merge branch 'PHP-7.4' 2019-07-22 12:28:40 +02:00
Nikita Popov
b3f74b0b7d Deprecate allow_url_include 2019-07-22 11:39:52 +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