Commit graph

13756 commits

Author SHA1 Message Date
Nikita Popov
a7b8131606 Drop unused variable 2018-09-18 12:12:36 +02:00
Nikita Popov
c625150b02 Remove legacy add_*_unset() macros
These have been superseded by add_*_null().
2018-09-18 12:12:36 +02:00
Nikita Popov
5cf2045b0a Remove add_method() macro
Which uses add_assoc_function(), which doesn't exist anymore...
2018-09-18 12:12:36 +02:00
Dmitry Stogov
689c6fb188 Replace ZEND_ACC_ANON_BOUND, ZEND_ACC_UNRESOLVED_PARENT and ZEND_ACC_UNRESOLVED_INTERFACES with single ZEND_ACC_LINKED. 2018-09-18 11:41:40 +03:00
Peter Kokot
b189c2432a Remove HAVE_STDARG_H
The C89 standard and later defines the `<stdarg.h>` header as part of
the standard headers [1]. On current systems it is always present and
can be included unconditionally.

Checking for presence and functionality of the `<stdarg.h>` header and
variadic function is not relevant anymore on current systems since this
is always available.

Also Autoconf suggests relying on at least C89 or above [2] and [3].

The following files were regenerated with re2c 1.0.3:
- Zend/zend_language_scanner.c
- Zend/zend_language_scanner_defs.h

Refs:
[1] https://port70.net/~nsz/c/c89/c89-draft.html#4.1.2
[2] http://git.savannah.gnu.org/cgit/autoconf.git/tree/lib/autoconf/headers.m4
[3] https://www.gnu.org/software/autoconf/manual/autoconf-2.69/autoconf.html
2018-09-18 05:44:56 +02:00
Peter Kokot
d3ca28f569 Remove HAVE_STRING_H
The C89 standard and later defines the `<string.h>` header as part of
the standard headers [1] and on current systems it is always present.

Code included also `<strings.h>` header as an alterinative in some
files. This kind of check was relevant on some older systems where the
`<strings.h>` file included definitions for the C89 compliant
`<string.h>`. Today such alternative check is not required anymore. The
`<strings.h>` file is part of the POSIX definition these days.

Also Autoconf suggests doing this and relying on C89 or above [2] and [3].

This patch also cleans few unused `<strings.h>` inclusions in the libmbfl.

[1]: https://port70.net/~nsz/c/c89/c89-draft.html#4.1.2
[2]: http://git.savannah.gnu.org/cgit/autoconf.git/tree/lib/autoconf/headers.m4
[3]: https://www.gnu.org/software/autoconf/manual/autoconf-2.69/autoconf.html
2018-09-18 05:32:08 +02:00
Nikita Popov
02664aee5c Remove ZEND_EARLY_BINDING_* constants
It seems like these were never actually used.
2018-09-17 20:59:16 +02:00
Nikita Popov
a79e5f705c Remove ZEND_OBJECTS_STORE_HANDLERS macro
Object store handlers are no longer a thing since PHP 7.
2018-09-17 20:59:16 +02:00
Nikita Popov
3c8e5432b0 Remove unused ZEND_CT and ZEND_RT constants 2018-09-17 20:59:16 +02:00
Dmitry Stogov
62338a2385 Use different loop terminating conditions 2018-09-17 20:39:28 +03:00
Dmitry Stogov
1154f6f70a Merge branch 'PHP-7.3'
* PHP-7.3:
  Allow switching back to Zend MM heap.
2018-09-17 20:21:05 +03:00
Dmitry Stogov
b25bc917ec Allow switching back to Zend MM heap. 2018-09-17 20:20:13 +03:00
Nikita Popov
ac03b15e3c Remove __USE_GNU defines
This is an internal glibc macro, it should not be necessary to use
it if we already define _GNU_SOURCE (we do through
AC_USE_SYSTEM_EXTENSIONS). Needing to use __USE_GNU generally
indicates an inclusion order problem (libc header included before
config.h).
2018-09-17 17:51:00 +02:00
Anatol Belski
44fa6be16e Set correct error code and adapt test 2018-09-17 17:19:39 +02:00
Nikita Popov
5776b4453d Remove unused MREMAP_MAYMOVE compatibility define 2018-09-17 13:48:39 +02:00
Anatol Belski
decdca664e Fix error setting, both errors are needed 2018-09-17 13:34:52 +02:00
Nikita Popov
b3f8a6341d Remove unused HAVE_MEM_MMAP_ANON and HAVE_MEM_MMAP_ZERO checks
These haven't been used since the MM rewrite in PHP 7.0. Nowadays
we assume that either MAP_ANON or MAP_ANONYMOUS is available.
2018-09-17 12:08:11 +02:00
Nikita Popov
f57be4bdbe Remove __GNUC__ guard around stddef.h include
HAVE_STDDEF_H guards have been removed by
6c1ff61a36, because the header is
always available in C89. This removes a __GNUC__ guard for the
same header.
2018-09-17 12:08:11 +02:00
Anatol Belski
321c0cc349 Fix localized error messages and memory leaks
The FormatMessage API needs to LocalFree the delivered error messages.
In cases where messages are delivered in non ASCII compatible encoding,
the messages might be unreadable. This aligns the error message encoding
with the encoding settings in PHP, the focus is UTF-8 as default.

Initialize error buffer

Avoid code duplication
2018-09-17 10:56:50 +02:00
Nikita Popov
178dcd4749 Perform final GC before the object store is freed
free_object_storage intentionally does not free the object allocations
to make sure that they show up as leaks. However, if the object is in
the GC root buffer, the later GC run may end up freeing the allocation,
hiding the leak.

Avoid this by moving the final GC run before free_object_storage, the
way it was done before fast_shutdown was integrated into core.
2018-09-17 10:13:55 +02:00
Peter Kokot
03bbdf275a Make PHP development tools files executable
This patch makes few remaining PHP development tools files
executable and adds a shebang to them.

The `#!/usr/bin/env php` shebang provides running the script via
`./script.php` and uses env to find PHP script location on the system.
At the same time it still provides running the script with a user
defined PHP location using `php script.php`. Shebang is not visible in
the output of the generated file.
2018-09-17 00:02:36 +02:00
Peter Kokot
7dd62811ce Remove HAVE_STDLIB_H
The C89 and later standard defines the `<stdlib.h>` header as part of
the standard headers [1] and on current systems it is always present
and the `HAVE_STDLIB_H` symbol can be removed.

Also Autoconf suggests doing this and relying on C89 or above [2] and [3].

[1] https://port70.net/~nsz/c/c89/c89-draft.html#4.1.2
[2] http://git.savannah.gnu.org/cgit/autoconf.git/tree/lib/autoconf/headers.m4
[3] https://www.gnu.org/software/autoconf/manual/autoconf-2.69/autoconf.html
2018-09-16 20:53:53 +02:00
Gabriel Caruso
f72b6c5e19
Use EXPECT instead of EXPECTF when possible 2018-09-16 15:39:18 -03:00
Nikita Popov
d51b9a690e Remove unnecessary destroy wrappers
There used to be needed due to ZEND_FILE_LINE in debug builds.
As the argument is no longer passed, we don't need the wrappers
either.
2018-09-16 17:16:26 +02:00
Nikita Popov
dfa166e7ed Remove unused ZEND_FILE_LINE in i_zval_ptr_dtor 2018-09-16 17:16:26 +02:00
Christoph M. Becker
6da3a1e3ce Revert "Implement #67331: Have parse_ini_file add empty entries"
This reverts commit 3f3e914df3.

The commit broke some tests on Windows, and generally needs more
though.
2018-09-15 17:08:58 +02:00
Christoph M. Becker
3f3e914df3 Implement #67331: Have parse_ini_file add empty entries
Some INI processors allow to specify empty values by just giving the
key without the equals sign, for instance MySQL and Python.  It appears
to be sensible to add this possibility to our INI parser, so that it
can be used for such INI files as well.  We choose NULL as the value of
empty values.

This syntactical enhancement is a (minor) BC break, though, as can be
seen by the necessary change to bug49692.ini.  The “comment” formerly
has been simply ignored, but now it would be parsed as key with an
empty value.

This PR is based on Adam's former patch.
2018-09-15 15:37:01 +02:00
Dmitry Stogov
7eb255e9db Merge branch 'PHP-7.3'
* PHP-7.3:
  Fixed bug #76800 (foreach inconsistent if array modified during loop)
2018-09-14 10:33:32 +03:00
Dmitry Stogov
17c7b71057 Merge branch 'PHP-7.2' into PHP-7.3
* PHP-7.2:
  Fixed bug #76800 (foreach inconsistent if array modified during loop)
2018-09-14 10:32:31 +03:00
Dmitry Stogov
3bc4a63fc2 Fixed bug #76800 (foreach inconsistent if array modified during loop) 2018-09-14 10:28:31 +03:00
Dmitry Stogov
49b92446d7 Remove zend_check_private() 2018-09-13 13:47:06 +03:00
Dmitry Stogov
bc288c4723 Simplify __clone() visibility check (magic methods still don't respect ZEND_ACC_CHANGED). 2018-09-13 13:36:09 +03:00
Dmitry Stogov
72bf2def6b Make visibilty check in is_callable() to be consistent with zend_std_get_method() 2018-09-13 12:24:59 +03:00
Dmitry Stogov
a12cd1c5e0 Split error code into "cold" functions and cleanup. 2018-09-13 10:31:49 +03:00
Dmitry Stogov
e1ef054be5 Micro-optimization (condition reordering) 2018-09-13 09:31:38 +03:00
Dmitry Stogov
eb4148e02d typo 2018-09-13 08:49:21 +03:00
Dmitry Stogov
f79270d876 Micro-optimization 2018-09-13 01:41:19 +03:00
Dmitry Stogov
cdeebfd4af Avoid unnecesury iterations over parent classes, in case of no overriden private properties. 2018-09-12 23:47:52 +03:00
Dmitry Stogov
5293dd9d8b Optimize method/property visibility checks 2018-09-12 18:59:12 +03:00
Dmitry Stogov
3444c260a2 Merge branch 'PHP-7.3'
* PHP-7.3:
  Fixed bug #76869 (Incorrect bypassing protected method accessibilty check).
2018-09-12 12:27:48 +03:00
Dmitry Stogov
655a99d131 Fixed bug #76869 (Incorrect bypassing protected method accessibilty check). 2018-09-12 12:16:50 +03:00
Dmitry Stogov
beb3594eb8 Better ZEND_ACC_CHANGED handling 2018-09-12 11:43:15 +03:00
Dmitry Stogov
aee4b145ef Optimisation: Check for private property in parent class makes sense only if we already found a property info. Check for property started with "\\0" makes sense only if we didn't find property info. 2018-09-12 09:57:36 +03:00
Dmitry Stogov
73efd1b651 Simplify method visibility checks 2018-09-12 08:31:01 +03:00
Dmitry Stogov
1cc0d78c9b This increment is not necessary anymore. 2018-09-11 22:56:31 +03:00
Dmitry Stogov
06f056a760 Additional fix for bug #76860. 2018-09-11 18:29:27 +03:00
Dmitry Stogov
0fbd2e6a16 Renumber ZEND_ACC_... flags 2018-09-11 17:21:17 +03:00
Dmitry Stogov
1570fe180f Removed weird test, trait can't be "static" or "final". 2018-09-11 17:07:06 +03:00
Nikita Popov
e1123e3e4e Drop unused variable 2018-09-11 15:16:11 +02:00
Dmitry Stogov
034b7ff091 Get rid of ZEND_ACC_IMPLICIT_PUBLIC 2018-09-11 12:26:26 +03:00