1
0
mirror of https://github.com/php/php-src.git synced 2026-04-29 03:03:26 +02:00
Commit Graph

110555 Commits

Author SHA1 Message Date
Nikita Popov 7d0d94e230 Use mremap in zend_mm_chunk_extend if available
As suggested by https://twitter.com/grsecurity. This saves an
mmap+munmap cycle in case the mapping cannot be extended in-place.
2019-02-18 12:06:59 +01:00
Dmitry Stogov 3ef9f23fce Fixed use-after-free during preloading, when q class with unresolved constant uses a preloaded trait. 2019-02-18 13:46:13 +03:00
Nikita Popov 05363890a0 Release constant names during preloading 2019-02-18 11:15:32 +01:00
Nikita Popov b7b3a600cb Don't suppress errors during in preload testing 2019-02-18 11:03:38 +01:00
Nikita Popov 2f3d61971f Don't catch opcache_compile_file failures during preloading
Compiler failures are not side-effect free, they may leave behind
parts of the file that were successfully compiled before the
failure occurred. The preloading code is not prepared to deal with
this.
2019-02-18 11:03:38 +01:00
Nikita Popov cc0e01a2fa Handle exception patterns in bless_tests.php 2019-02-18 11:03:38 +01:00
Tom Van Herreweghe 5b15908ed7 Test the warning for giving full path to dl() 2019-02-17 20:22:23 +01:00
MarkBaker cf0dd817f2 Tests for XMLWriter write cdata and raw 2019-02-17 19:43:19 +01:00
MarkBaker a84227650a SplDoublyLinkedList Iterating a DLL by reference shouldn't be permitted 2019-02-17 19:35:13 +01:00
MarkBaker 40a26587e8 Range of new tests for xmlreader functionality and exceptions/errors 2019-02-17 19:23:01 +01:00
Peter Kokot 90054c1a69 Remove unused --copy option from the makedist
The --copy option was once used with Automake. It has been
removed via 128119b9ab.
2019-02-16 21:48:45 +01:00
Peter Kokot e0c88039b6 Move some scripts from root directory to scripts/dev/
At the time of this commit, there is a dedicated folder for development
related tools and such scripts might fit better there to not bloat the
project root directory too much.

Move snapshot to scripts/dev/snapshot
2019-02-16 16:58:48 +01:00
Andrea Faulds 6662fb5c8f run-tests.php: fix all tab-space indentation inconsistency 2019-02-16 01:54:16 +01:00
Andrea Faulds 41fbeb6c56 run-tests.php: move all top-level code into a function
Prerequisite for parallelised testing:
https://github.com/php/php-src/pull/2822

Quoth Nikita @
https://github.com/php/php-src/pull/3789#issuecomment-462724550:

> @hikari-no-yume Please feel free to directly commit the first commit
> (to PHP-7.4). That's probably a big and unnecessary source of
> conflicts, and makes reviewing harder as well.
2019-02-16 01:05:04 +01:00
Christoph M. Becker f1588d841c Merge branch 'PHP-7.3' into PHP-7.4
* PHP-7.3:
  Fix #77626: Persistence confusion in php_com_import_typelib()
2019-02-15 18:57:17 +01:00
Christoph M. Becker 767fa3dc02 Fix #77626: Persistence confusion in php_com_import_typelib()
We apply only the most minimal fix here, and will cater to the
unnecessary re-allocation for PHP-7.4.

We don't need to add a regression test, since bug39606.phpt and
bug77621.phpt already show the misbehavior.
2019-02-15 18:56:24 +01:00
Nikita Popov e15d657c1a Link anonymous classes during preloading 2019-02-15 17:50:40 +01:00
Nikita Popov 970dcd240f Don't assume that all includes have been executed 2019-02-15 17:36:40 +01:00
Nikita Popov 1b31b45f6f Set filename & lineno information for preload inheritance error 2019-02-15 17:03:57 +01:00
Nikita Popov 92fae00ee0 Handle bailouts during preload linking 2019-02-15 16:56:32 +01:00
Nikita Popov a9497cecf3 Fix preload auto globals handling
We need to compute the auto globals mask before EG(symbol_table)
is cleaned out.
2019-02-15 16:37:12 +01:00
Christoph M. Becker 0520eb8772 Deprecate marking typelibs to load constants case-insensitively
This is an amendment to commit fae2246[1] which missed this opportunity
to still introduce case-insensitive constants without a deprecation
warning.

[1] <http://git.php.net/?p=php-src.git;a=commit;h=fae22461f95dfe8153fb74a53b9c5daeec47387f>
2019-02-15 16:24:54 +01:00
Dmitry Stogov d4bef4ce7b Avoid useless code duplication, because of unused specialization 2019-02-15 17:49:39 +03:00
rjhdby d6a53ed5e0 Unify clone method error message 2019-02-15 15:08:02 +01:00
Dmitry Stogov 78a1d76962 Reduce slow code size 2019-02-15 17:03:04 +03:00
Nikita Popov e6e9bea257 Avoid uninitialized entries in properties_info_table
Also don't place it into xlat, there's only ever one user.
2019-02-15 14:43:37 +01:00
Christoph M. Becker fae22461f9 Deprecate case-insensitive constants via typelib import
As of PHP 7.3.0, case-insensitive constants are deprecated.  We catch
up on this with regard to ext/com_dotnet, which allows to import
constants from typelibs, by triggering a deprecation notice whenever
`com_load_typelib()` is called with `$case_sensitive` being `false`,
and whenever `com.autoregister_casesensitive` is set to `false`,
regardless of whether there are actually constants in the typelib which
would be imported.
2019-02-15 13:07:56 +01:00
Nikita Popov ade9d5e95b Suppress zend_throw_error during preload constant resolution
Related to bug #77615.
2019-02-15 13:03:46 +01:00
Nikita Popov c15007956d Add preloading support for typed properties
During preloading, try to resolve all property types to CEs. Add a
flag that tracks this. If not all property types can be resolved,
then the class is not eligible for preloading.
2019-02-15 12:41:45 +01:00
Nikita Popov a2e9534798 Add a --preload testing mode to run-tests.php
Not intended for general use, it has many false positives.
2019-02-15 11:23:23 +01:00
Nikita Popov 3cafa7f4df Assign (un)serialize_func during compilation
This avoids writing this cache at runtime, which is illegal if
preloading is used.

Not every serialize/unserialize function actually belongs to the
Serializable interface, but I think it's not a problem to assign
these anyway -- whether they are used ultimately depends on whether
Serializable is implemented.

Alternatively it might make sense to just drop these entirely. I
don't think this is performance critical functionality.
2019-02-15 11:20:28 +01:00
Nikita Popov ffc7e953ea properties_info_table may be in arena or shm
For immutable classes it should be shm instead of in arena.

Related to bug #77615.
2019-02-15 10:27:30 +01:00
Christoph M. Becker c62e106610 Merge branch 'PHP-7.3' into PHP-7.4
* PHP-7.3:
  Fix #77621: Already defined constants are not properly reported
2019-02-15 00:39:10 +01:00
Christoph M. Becker 8946ad3000 Merge branch 'PHP-7.2' into PHP-7.3
* PHP-7.2:
  Fix #77621: Already defined constants are not properly reported
2019-02-15 00:37:39 +01:00
Christoph M. Becker de738496c2 Fix #77621: Already defined constants are not properly reported
We must not check uninitialized values (i.e. `c.value`), and we have to
use proper types for printf-style formats (i.e. `char *` instead of
`zend_string *`).
2019-02-15 00:35:21 +01:00
BlackEagle fee9f3a8f4 gd imageloadfont test while reading header
Cover error when the header of an gd font loading is interrupted by end
of file.

Signed-off-by: BlackEagle <ike.devolder@gmail.com>
2019-02-14 22:29:35 +01:00
Rodrigo Prado de Jesus c2eb68aafe Add test to function posix_getlogin()
Increased the coverage lines 587-595 in file ext/posix/posix.c

User Groups: PHPVale   PHPSP   PHPDF    PHPWomenBR

Hangout presented by #PHPTestFestBrasil on 2017-11-14
https://www.youtube.com/watch?v=bBWkzZEadNo
2019-02-14 20:49:25 +01:00
Rodrigo Prado 2c90beacf0 Create posix_getpwnam_basic_01.phpt
User Group: PHPSP #phptestfestbrasil
2019-02-14 20:36:53 +01:00
Riccardo Magliocchetti 4411cb6656 Add basic test for posix getgrnam 2019-02-14 20:28:11 +01:00
Rodrigo Prado 34ca922125 Small change in the test to pass
This test was not passing because the VM called by travis CI is slow, see below the failure:
http://gcov.php.net/viewer.php?version=PHP_HEAD&func=tests&file=ext%2Ffileinfo%2Ftests%2Fcve-2014-3538-mb.phpt
User Group: PHPSP #phptestfestbrasil
http://phpsp.org.br/
2019-02-14 20:12:00 +01:00
Robrecht Plaisier 31a01302dd Added basic stream_filter_register test 2019-02-14 20:03:35 +01:00
rjhdby 6bf1f434f0 use local resources instead remote 2019-02-14 19:51:40 +01:00
Fabien Villepinte b996476578 Remove outdated pgsql README
[ci skip]
2019-02-14 17:06:37 +01:00
Nikita Popov adf2f39745 Fix build without global regs 2019-02-14 14:01:39 +01:00
Nikita Popov 29d87caebf Fix typo in XML test
Uncovered by the change in e63febb1c7.
2019-02-14 12:59:08 +01:00
David Walker e63febb1c7 Fixed bug #75921
Ensure that the "creating default object from empty value" warning is
always thrown. Previously some cases were missing the warning, in
particular those going through FETCH_OBJ_W rather than a dedicated
opcode (like ASSIGN_OBJ).

One slightly unfortunate side-effect of this change is that something
like $a->b->c = 'd' will now generate two warnings rather than one
when $a is null (one for property b, one for property c).
2019-02-14 12:50:25 +01:00
Nikita Popov dab5462484 Use #ifdef instead of #if 2019-02-14 11:56:33 +01:00
Nikita Popov 96daef0458 Make ABI of SIMD optimized functions independent of compiler flags
Always export these as normal functions and only use function pointers
internally if necessary.
2019-02-14 11:49:21 +01:00
Nikita Popov 1a5cff334d Remove bogus ctor checks in get_class_methods() + reflection
Contrary to the comments, these only hide constructors (old or new
style) if they a) are inherited b) come from a trait and c) are
aliased -- which doesn't make any sense at all.
2019-02-14 11:47:31 +01:00
Dmitry Stogov 43a7d95016 Fixed bug #77613 (method visibility change) (reverted ZEND_ACC_CTOR and ZEND_ACC_DTOR flags removal) 2019-02-14 13:12:50 +03:00