Commit graph

118300 commits

Author SHA1 Message Date
Nikita Popov
30a5f3da99 printf: Report error if missing padding character 2020-04-22 10:14:30 +02:00
George Peter Banyard
0b99017516 Fix error message in ext/socket 2020-04-22 00:50:32 +02:00
George Peter Banyard
7ff8eaa545 Promote warnings to Errors in sockets's extension. 2020-04-21 20:41:26 +02:00
Nikita Popov
2aa661887f Remove redundant vfprintf/vsprintf variation tests
These duplicate vprintf() variation tests. While it's useful to
test the vfprintf() and vsprintf() variants of the function, the
main formatting machinery is shared between them, and it makes
little sense to repeat the full set of format tests for all of
them.
2020-04-21 18:26:59 +02:00
Nikita Popov
40ceafc7f2 Fix number of required parameters in printf
If n$ references are involved, the maximum argnum referenced may
not the one at the end. Store it explicitly.
2020-04-21 17:01:47 +02:00
Dmitry Stogov
94fba02621 Reuse registers allocated for parent trace in side traces 2020-04-21 17:34:31 +03:00
Dmitry Stogov
333a28ed58 Register allocation is useless if JIT just calls standarad VM handlers 2020-04-21 14:56:56 +03:00
Nikita Popov
292085f336 Generate zend_builtin_functions FEs from stubs 2020-04-21 12:23:56 +02:00
Dmitry Stogov
832cfa15eb Removed old TODO 2020-04-21 12:07:36 +03:00
Nikita Popov
370c00e9cf Add crude memory limit to tracked alloc
Check whether the requested allocation size exceeds limit (rather
than the cumulative size).

This is useful to prevent allocations triggering OOM during fuzzing.
2020-04-21 10:44:15 +02:00
Nikita Popov
fa4bdf1cda Make gen_stub parallelism safe
If PHP-Parser is not yet installed, make sure we don't try to
install it N times in parallel.
2020-04-21 10:20:51 +02:00
Symeon Charalabides
d554d91ce7 Ensure hash_update_stream() always returns the same hash when $length = 0 2020-04-21 08:55:15 +02:00
Christoph M. Becker
321d9d9ae3 Fix OPcache build
`||` at the beginning of a line has special meaning for the DynAsm
preprocessor.
2020-04-20 17:40:16 +02:00
Christoph M. Becker
3d1b730c11 Fix #71417: fread() does not report zlib.inflate errors
If the zlib.inflate filter fails to decompress the stream, we raise a
notice instead of failing silently.
2020-04-20 16:49:08 +02:00
Nikita Popov
661c0ac7f3 Remove support for EBCDIC
Closes GH-5390.
2020-04-20 16:39:39 +02:00
Nikita Popov
58f9c4053e Merge branch 'PHP-7.4'
* PHP-7.4:
  Don't rand() in test
2020-04-20 16:37:19 +02:00
Nikita Popov
3e9dac2c6b Don't rand() in test
Instead use port 0 to get a free port from the OS.
2020-04-20 16:35:52 +02:00
Dmitry Stogov
b0b43e86ae Register allocator and deoptimizer for tracing JIT. 2020-04-20 16:02:03 +03:00
Christoph M. Becker
d757be640f Fix #71263: fread() does not report bzip2.decompress errors
If the bzip2.decompress filter fails to decompress the stream, we raise
a notice instead of failing silently.
2020-04-20 14:21:50 +02:00
Máté Kocsis
6111d64cda
Improve a last couple of argument error messages
Closes GH-5404
2020-04-20 13:09:00 +02:00
Nikita Popov
283d37ad8f Merge branch 'PHP-7.4'
* PHP-7.4:
  Fix file name clash in touch_variation1.phpt
2020-04-20 12:07:59 +02:00
Nikita Popov
5c40491567 Fix file name clash in touch_variation1.phpt 2020-04-20 12:07:46 +02:00
Nikita Popov
3d5db42ca5 Merge branch 'PHP-7.4'
* PHP-7.4:
  Fix bug #67369 ArrayObject serializatino drops the iterator class
2020-04-20 11:56:35 +02:00
Alex Dowad
0d11d37357 Fix bug #67369 ArrayObject serializatino drops the iterator class
When ArrayObject is round-tripped through serialize() and unserialize(),
it forgets any iterator class name which was set using ::setIteratorClass().
Fix that.
2020-04-20 11:55:18 +02:00
Christoph M. Becker
193cb97a0e Merge branch 'PHP-7.4'
* PHP-7.4:
  Fix #79491: Search for .user.ini extends up to root dir
2020-04-20 11:00:01 +02:00
Christoph M. Becker
18ad38a7b2 Merge branch 'PHP-7.3' into PHP-7.4
* PHP-7.3:
  Fix #79491: Search for .user.ini extends up to root dir
2020-04-20 10:58:33 +02:00
Christoph M. Becker
fa10abd6d7 Fix #79491: Search for .user.ini extends up to root dir
The `start` parameter of `php_cgi_ini_activate_user_config` is supposed
to hold the byte offset of the doc root in the given `path`.  However,
the current expression which fixes a potential type incompatibility
will ever only evaluate to zero or one, because it uses the *logical*
and operator (`&&`).  Furthermore we notice that subtracting one from
`doc_root_len` is not necessary, so there is even no need for the
`start` parameter at all.
2020-04-20 10:56:36 +02:00
Nikita Popov
ae5d7e4e96 Merge branch 'PHP-7.4'
* PHP-7.4:
  Apply doc root fix for FPM
2020-04-20 10:48:20 +02:00
Nikita Popov
721ca87e56 Merge branch 'PHP-7.3' into PHP-7.4
* PHP-7.3:
  Apply doc root fix for FPM
2020-04-20 10:48:05 +02:00
Nikita Popov
f62571c121 Apply doc root fix for FPM
This is the change from GH-5417 but for FPM. This was stripping the
last character from the doc_root. Given how it is used, this should
be harmless, but let's make it less confusing...
2020-04-20 10:47:54 +02:00
Máté Kocsis
9955230312
Fix order of ZPP in ext/sqlite3 2020-04-20 10:39:09 +02:00
Máté Kocsis
4815be44db
Generate function entries from stubs
Converts ext/pcntl, ext/simplexml, ext/snmp, ext/soap, ext/sqlite3.
Closes GH-5421
2020-04-20 10:38:41 +02:00
Nikita Popov
8e9bc90004 Merge branch 'PHP-7.4'
* PHP-7.4:
  Fix #79497: Fix php_openssl_subtract_timeval()
2020-04-20 10:26:45 +02:00
Nikita Popov
a230b5a6c9 Merge branch 'PHP-7.3' into PHP-7.4
* PHP-7.3:
  Fix #79497: Fix php_openssl_subtract_timeval()
2020-04-20 10:26:22 +02:00
Joe Cai
94e09bfe55 Fix #79497: Fix php_openssl_subtract_timeval()
I stumbled upon this while debugging a strange issue with
stream_socket_client() where it randomly throws out errors when
the connection timeout is set to below 1s. The logic to calculate
time difference in php_openssl_subtract_timeval() is wrong when
a.tv_usec < b.tv_usec, causing connection errors before the timeout
is reached.
2020-04-20 10:25:54 +02:00
Tyson Andre
cd56395d47 Speed up ZEND_SWITCH_STRING/ZEND_SWITCH_LONG for wrong type
This has the minor benefit of avoiding loading the address of the
jump table when the expression for the switch isn't a string/long.
gcc doesn't seem to optimize that.

The previous function body is the original implementation: ad8652818a

```
// Before: 0.267s, after: 0.265s
function test_switch($x) {
    for ($i = 0; $i < 10000000; $i++) {
        switch ($x) {
        case 'a':
        case 'b':
            echo "i=$i\n";
        }
    }
}
test_switch(null);
```

Closes GH-5419
2020-04-19 17:31:18 -04:00
Máté Kocsis
928b25cd6e
Generate function entries from stubs for mysqli
Closes GH-5420
2020-04-19 21:56:47 +02:00
Tyson Andre
4e1219ac88 [skip ci] Fix typos in jit code comments
And in Opcache's zend_cfg.h

Closes GH-5414
2020-04-19 10:03:49 -04:00
George Peter Banyard
3b9d33dc20 [skip ci] Fix comment in Tidy autoconf file 2020-04-19 15:53:06 +02:00
Benjamin Eberlei
ec88bbc4c6 Enhance test failure SH script to allow gdb, valgrind, rr as alternative modes. 2020-04-18 16:14:00 +02:00
George Peter Banyard
826a745671 Fix [-Wjump-misses-init] in generated zend_opcode.c 2020-04-18 14:52:49 +02:00
George Peter Banyard
594287a736 Fix [-Wjump-misses-init] warning in MySQL new driver extension 2020-04-18 14:52:49 +02:00
George Peter Banyard
925679b057 Fix [-Wjump-misses-init] in spl_directory.c by adding an inner scope 2020-04-18 14:52:48 +02:00
George Peter Banyard
9f8eb9d515 Fix [-Wjump-misses-init] in sockets extension 2020-04-18 14:52:48 +02:00
George Peter Banyard
2a4c81f1ee Fix [-Wjump-misses-init] in php_mbregex.c by adding an inner scope 2020-04-18 14:52:48 +02:00
Nikita Popov
08c5c69eff Remove ZEND_ACC_DTOR flag
This is only used in reflection, where doing a simple string check
is acceptable.

I'm also dropping the "dtor" printing in the reflection dump.
Dtors are just one of many magic methods, I don't think there's
a point in explicitly highlighting them, when the name is already
unambiguous.
2020-04-17 15:32:47 +02:00
Nikita Popov
7352213b38 Early return if variadic type check fails
Don't check all the remaining arguments after one check failed.
I don't think this makes an observable behavior difference,
because we already suppress duplicate exceptions in argument
type error reporting.
2020-04-17 14:24:44 +02:00
Christoph M. Becker
7574823911 Enable JIT for AppVeyor CI
This is not supposed to bring any test performance optimization, but
allows us to test basic JIT functionality on Windows.
2020-04-17 14:17:14 +02:00
Dmitry Stogov
1a5a6d72a1 Merge branch 'PHP-7.4'
* PHP-7.4:
  zend_timeout() may access EX(opline)
2020-04-17 14:56:18 +03:00
Dmitry Stogov
b2376be81d Merge branch 'PHP-7.3' into PHP-7.4
* PHP-7.3:
  zend_timeout() may access EX(opline)
2020-04-17 14:56:01 +03:00