]>
granicus.if.org Git - php/log
Tyson Andre [Sun, 6 Sep 2020 16:29:32 +0000 (12:29 -0400)]
Fix incorrect/unused macro
zend_ts_hash_init accepts 4 arguments, not 5.
The pHashFunction parameter was removed in
5d2576264653c2faaca9cd7d64218d10ab612408
Closes GH-6087
Tyson Andre [Sun, 6 Sep 2020 13:43:09 +0000 (09:43 -0400)]
Improve handling of `#[` attributes in `php -a`
`php -a` treats lines starting with `#` as comments when deciding if
the provided statement is valid.
So it passed `#[MyAttr]` to the parser after the user hits enter,
causing a syntax error for multi-line statements..
With this patch, the following snippet is parsed correctly
```
php > #[Attr]
php > function x() { }
php > var_export((new ReflectionFunction('x'))->getAttributes()[0]->getName());
'Attr'
```
Followup to GH-6085
Closes GH-6086
Tyson Andre [Sat, 5 Sep 2020 20:52:14 +0000 (16:52 -0400)]
Improve handling of `#[` in `php -a`
PHP treats `#ini_setting=value` as a call to
`ini_set('ini_setting', 'value')`,
and silently skips undeclared settings.
This is a problem due to `#[` becoming supported attribute syntax:
- `#[Attr] const X = 123;` (this is not a valid place to put an attribute)
This does not create a constant.
- `#[Attr] function test($x=false){}` also contains `=`.
This does not create a function.
Instead, only treat lines starting with `#` as a special case
when the next character isn't `[`
Closes GH-6085
Nikita Popov [Sat, 5 Sep 2020 20:10:12 +0000 (22:10 +0200)]
Merge branch 'PHP-7.4'
* PHP-7.4:
Fix azure i386 build
Nikita Popov [Sat, 5 Sep 2020 19:39:39 +0000 (21:39 +0200)]
Fix azure i386 build
Looks like pgsql on i386 broke even more.
Nikita Popov [Fri, 4 Sep 2020 15:15:35 +0000 (17:15 +0200)]
Handle null encoding in mb_http_input()
Nikita Popov [Fri, 4 Sep 2020 13:22:11 +0000 (15:22 +0200)]
Reenable s390x on travis
Only enable it for cron builds. We don't need to run exotic
architectures on every commit and PR.
Closes GH-6076.
Derick Rethans [Fri, 4 Sep 2020 14:55:08 +0000 (15:55 +0100)]
Fixed bug #80057 (DateTimeImmutable::createFromFormat() does not populate time)
Máté Kocsis [Thu, 3 Sep 2020 14:21:36 +0000 (16:21 +0200)]
Promote warnings to exceptions in ext/ldap
Closes GH-6065
Máté Kocsis [Fri, 4 Sep 2020 12:23:43 +0000 (14:23 +0200)]
Use ZPP instead of custom type checks
We can add these types as a native type declaration to stubs as a side-effect. Closes GH-6068
Máté Kocsis [Fri, 4 Sep 2020 12:20:15 +0000 (14:20 +0200)]
Use the canonical order of types in array|string ZPP error messages
Máté Kocsis [Fri, 4 Sep 2020 12:15:17 +0000 (14:15 +0200)]
Add the Z_PARAM_ARRAY_HT_OR_NULL and Z_PARAM_OBJ macros
George Peter Banyard [Thu, 3 Sep 2020 13:49:28 +0000 (15:49 +0200)]
Extract common flock code
As SPL is currently a copie of the code in file.c
Closes GH-6069
Nikita Popov [Fri, 4 Sep 2020 07:41:27 +0000 (09:41 +0200)]
Release call trampolines in zpp fcc
When using zpp 'f' or Z_PARAM_FUNC, if the fcc points to a call
trampoline release it immediately and force zend_call_function
to refetch it. This may require additional callability checks
if __call is used, but avoids the need to carefully free fcc
values in all internal functions -- in some cases this is not
simple, as a type error might be triggered by a later argument
in the same zpp call.
This fixes oss-fuzz #25390.
Closes GH-6073.
Nikita Popov [Fri, 4 Sep 2020 10:34:47 +0000 (12:34 +0200)]
Update travis to bionic
Nikita Popov [Fri, 4 Sep 2020 10:59:42 +0000 (12:59 +0200)]
Make gethostbyname() test more liberal
This returns 127.0.1.1 on travis bionic.
Nikita Popov [Fri, 4 Sep 2020 09:00:09 +0000 (11:00 +0200)]
Merge branch 'PHP-7.4'
* PHP-7.4:
Avoid duplicate octal warning during heredoc scan ahead
Nikita Popov [Fri, 4 Sep 2020 08:15:55 +0000 (10:15 +0200)]
Disable InfiniteIterator class while fuzzing
The combination of LimitIterator and InfiniteIterator can cause
effectively infinite loops that bypass the executor step limit.
Nikita Popov [Fri, 4 Sep 2020 08:59:41 +0000 (10:59 +0200)]
Merge branch 'PHP-7.3' into PHP-7.4
* PHP-7.3:
Avoid duplicate octal warning during heredoc scan ahead
Nikita Popov [Fri, 4 Sep 2020 08:58:51 +0000 (10:58 +0200)]
Avoid duplicate octal warning during heredoc scan ahead
Dmitry Stogov [Fri, 4 Sep 2020 08:42:13 +0000 (11:42 +0300)]
Avoid unnecessary IP initiliaization on trace linking
Dmitry Stogov [Thu, 3 Sep 2020 23:10:48 +0000 (02:10 +0300)]
Cleanup macro/function names
Dmitry Stogov [Thu, 3 Sep 2020 20:53:02 +0000 (23:53 +0300)]
Load EX(opline) in one instuction if possible
Dmitry Stogov [Thu, 3 Sep 2020 20:52:24 +0000 (23:52 +0300)]
Reorder DynAsm macros (no other changes)
George Peter Banyard [Thu, 3 Sep 2020 15:17:46 +0000 (17:17 +0200)]
Error promotions in SPL
Warning to Error promotion and a Notice to Warning promotion to align
with the behaviour specified in the Reclassify Engine Warnings RFC.
Closes GH-6072
George Peter Banyard [Thu, 3 Sep 2020 15:43:57 +0000 (17:43 +0200)]
Warning to Error promotion in ext/standard
Those should be the last ones other than set(raw)cookie()
Closes GH-5814
Nikita Popov [Thu, 3 Sep 2020 15:13:47 +0000 (17:13 +0200)]
Merge branch 'PHP-7.4'
* PHP-7.4:
Fixed bug #80049
Nikita Popov [Thu, 3 Sep 2020 15:12:50 +0000 (17:12 +0200)]
Merge branch 'PHP-7.3' into PHP-7.4
* PHP-7.3:
Fixed bug #80049
Nikita Popov [Thu, 3 Sep 2020 15:10:34 +0000 (17:10 +0200)]
Fixed bug #80049
Type checking may convert to refcounted values, so force freeing
of extra args.
Dmitry Stogov [Thu, 3 Sep 2020 14:12:23 +0000 (17:12 +0300)]
If we don't know the return address, just escape to VM, instead of adding side exit.
Remove unnecessary exception checks.
Alex Dowad [Fri, 7 Aug 2020 20:29:21 +0000 (22:29 +0200)]
Use symbolic constants in Japanese kana conversion code (not magic numbers)
Also correct misspelling of 'hiragana' as 'hirangana' at the same time.
Alex Dowad [Tue, 28 Jul 2020 21:30:16 +0000 (23:30 +0200)]
Remove unused 'from' field from mbfl_buffer_converter struct
Alex Dowad [Fri, 17 Jul 2020 20:36:39 +0000 (22:36 +0200)]
Add comment to mbfilter_tl_jisx0201_jisx0208.h
Explain the 'ZEN' and 'HAN' in symbolic constant names.
Alex Dowad [Thu, 16 Jul 2020 07:23:37 +0000 (09:23 +0200)]
Remove unneeded function mbfl_filt_ident_common_dtor
This was the default destructor for mbfl_identify_filter structs, but there's nothing
we actually need to do to those structs before freeing them.
Alex Dowad [Thu, 16 Jul 2020 07:15:56 +0000 (09:15 +0200)]
Remove unneeded function mbfl_filt_conv_common_dtor
This is a default destructor for mbfl_convert_filter structs. The thing is: there
isn't really anything that needs to be done to those structs before freeing them.
The default destructor just zeroed out some fields, but there's no reason why
we should actually do that.
Alex Dowad [Wed, 15 Jul 2020 19:56:33 +0000 (21:56 +0200)]
Refactor mbfl_convert.c
Christoph M. Becker [Thu, 3 Sep 2020 13:46:30 +0000 (15:46 +0200)]
Merge branch 'PHP-7.4' into master
* PHP-7.4:
Fix #80048: Bug #69100 has not been fixed for Windows
Christoph M. Becker [Thu, 3 Sep 2020 13:44:38 +0000 (15:44 +0200)]
Merge branch 'PHP-7.3' into PHP-7.4
* PHP-7.3:
Fix #80048: Bug #69100 has not been fixed for Windows
Christoph M. Becker [Thu, 3 Sep 2020 12:27:45 +0000 (14:27 +0200)]
Fix #80048: Bug #69100 has not been fixed for Windows
We fix the erroneous length calculation on Windows, too.
Closes GH-6067.
Christoph M. Becker [Thu, 3 Sep 2020 13:28:30 +0000 (15:28 +0200)]
Fix Windows build
Nikita Popov [Thu, 3 Sep 2020 13:06:42 +0000 (15:06 +0200)]
Try to fix windows build
Levi Morrison [Thu, 3 Sep 2020 13:03:12 +0000 (07:03 -0600)]
Add Z_PARAM_ITERABLE and co
George Peter Banyard [Thu, 3 Sep 2020 12:15:18 +0000 (14:15 +0200)]
Refactor parts of SPL Dir/SplFileObject
This fixes a way it was possible to trigger an Internel Error
by disabling function (via the INI setting) when SPL was acting
as a proxy to the function call.
Fix flock_compat layer as it needs to used in SPL now.
Use macro to check if object is initialized
Closes GH-6014
George Peter Banyard [Thu, 3 Sep 2020 11:05:50 +0000 (13:05 +0200)]
Fix mismatch between macro and struct definition
Nikita Popov [Thu, 3 Sep 2020 10:59:30 +0000 (12:59 +0200)]
Fix leaks in sapi tests
Make sure to always free compiled_filename on shutdown.
Nikita Popov [Thu, 3 Sep 2020 09:56:55 +0000 (11:56 +0200)]
Don't intern compiled_filename
For php-ast interning the file name is an effective memory leak,
see php-ast#134.
I don't think there's any reason to do this. At some point this
was needed due to bugs in the interned string mechanism that
caused issues if the string was later interned, e.g. through a
__FILE__ reference. These issues have since been resolved.
In conjunction with the filenames_table removal in
c4016ecd446ef26bb3dc77735b6e441e151ea985
this means that filenames now need to be refcounted like normal
strings. In particular the filename reference in op_arrays and CEs
are refcounted.
Nikita Popov [Thu, 3 Sep 2020 09:30:58 +0000 (11:30 +0200)]
Remove CG(filenames_table)
This doesn't seem to serve any purpose anymore.
Nikita Popov [Thu, 3 Sep 2020 09:19:11 +0000 (11:19 +0200)]
Merge branch 'PHP-7.4'
* PHP-7.4:
Fixed bug #80046
Nikita Popov [Thu, 3 Sep 2020 09:16:50 +0000 (11:16 +0200)]
Fixed bug #80046
We already protect against optimizing away loop frees in DFA pass,
but not in block pass.
Nikita Popov [Thu, 3 Sep 2020 09:18:11 +0000 (11:18 +0200)]
Merge branch 'PHP-7.4'
* PHP-7.4:
Fixed bug #80046
Nikita Popov [Thu, 3 Sep 2020 09:16:50 +0000 (11:16 +0200)]
Fixed bug #80046
We already protect against optimizing away loop frees in DFA pass,
but not in block pass.
Dmitry Stogov [Thu, 3 Sep 2020 09:06:06 +0000 (12:06 +0300)]
JIT for FE_FETCH_R
Christoph M. Becker [Thu, 3 Sep 2020 08:33:35 +0000 (10:33 +0200)]
Merge branch 'PHP-7.4' into master
* PHP-7.4:
Skip test if A: drive exists
Christoph M. Becker [Thu, 3 Sep 2020 08:30:39 +0000 (10:30 +0200)]
Merge branch 'PHP-7.3' into PHP-7.4
* PHP-7.3:
Skip test if A: drive exists
Christoph M. Becker [Thu, 3 Sep 2020 08:26:05 +0000 (10:26 +0200)]
Skip test if A: drive exists
Otherwise the test case will fail for a very different reason.
Nikita Popov [Thu, 3 Sep 2020 08:29:18 +0000 (10:29 +0200)]
Fixed bug #80045
Applying the obvious fix ... however, I think we may need to
rething how we handle trampoline fcc for "f" zpp. It might make
sense to use fcc->function_handler == NULL for that case and
force it to be fetched in zend_call_function instead (it will
be reset to that after the call anyway). Otherwise we will keep
chasing these leaks, as it's the only instance where it's
necessary to free a zpp result.
Nikita Popov [Thu, 3 Sep 2020 07:51:54 +0000 (09:51 +0200)]
Merge branch 'PHP-7.4'
* PHP-7.4:
Handle memory limit error during string reallocation correctly
Nikita Popov [Thu, 3 Sep 2020 07:51:35 +0000 (09:51 +0200)]
Merge branch 'PHP-7.3' into PHP-7.4
* PHP-7.3:
Handle memory limit error during string reallocation correctly
Dmitry Stogov [Thu, 3 Sep 2020 07:49:58 +0000 (10:49 +0300)]
Fixed support for deprecated constants (Zend/tests/const_deprecation.phpt failure)
Nikita Popov [Thu, 3 Sep 2020 07:45:54 +0000 (09:45 +0200)]
Handle memory limit error during string reallocation correctly
Do not decrement the refcount before allocating the new string,
as the allocation operation may bail out and cause a use-after-free
lateron. We can only decrement the refcount once the allocation
has succeeded.
Fixes oss-fuzz #25384.
Dmitry Stogov [Wed, 2 Sep 2020 21:51:43 +0000 (00:51 +0300)]
JIT for FETCH_CONSTANT
Dmitry Stogov [Wed, 2 Sep 2020 20:16:58 +0000 (23:16 +0300)]
Reorder switch cases for consistency between zend_jit() and zend_jit_trace()
Anatol Belski [Wed, 2 Sep 2020 19:25:00 +0000 (21:25 +0200)]
libmagic: Update patch
[ci skip]
Signed-off-by: Anatol Belski <ab@php.net>
Alex Dowad [Thu, 30 Jul 2020 20:08:25 +0000 (22:08 +0200)]
Fix typos in mbstring tests
Man, I can be pedantic sometimes. Tiny little things like misspelled words just
hurt me inside. So while it's not really a big deal, I couldn't leave these typos
alone...
Benjamin Eberlei [Wed, 2 Sep 2020 18:32:52 +0000 (20:32 +0200)]
Update NEWS, UPGRADING
Benjamin Eberlei [Sat, 15 Aug 2020 08:39:00 +0000 (10:39 +0200)]
Change Attribute Syntax from @@ to #[]
Anatol Belski [Wed, 2 Sep 2020 18:04:00 +0000 (20:04 +0200)]
Revert "libmagic: Move the allocation on the stack"
This reverts commit
1d84a58736541b61fc9d569580715940e32d55c9 .
Signed-off-by: Anatol Belski <ab@php.net>
Dmitry Stogov [Wed, 2 Sep 2020 17:10:02 +0000 (20:10 +0300)]
JIT for FE_FETCH_R
Anatol Belski [Wed, 2 Sep 2020 15:04:57 +0000 (17:04 +0200)]
libmagic: Constify arg
Anatol Belski [Wed, 2 Sep 2020 14:58:44 +0000 (16:58 +0200)]
libmagic: Move the allocation on the stack
Anatol Belski [Wed, 2 Sep 2020 14:57:27 +0000 (16:57 +0200)]
hash: Fix warning in the bench script
Nikita Popov [Wed, 2 Sep 2020 15:05:18 +0000 (17:05 +0200)]
Extend function blacklist in execute fuzzer
Add pfsockopen and stream_socket_server.
Nikita Popov [Wed, 2 Sep 2020 14:46:49 +0000 (16:46 +0200)]
Merge branch 'PHP-7.4'
* PHP-7.4:
Fix binary-safety of parse_url
Nikita Popov [Wed, 2 Sep 2020 14:45:57 +0000 (16:45 +0200)]
Merge branch 'PHP-7.3' into PHP-7.4
* PHP-7.3:
Fix binary-safety of parse_url
Nikita Popov [Wed, 2 Sep 2020 14:43:00 +0000 (16:43 +0200)]
Fix binary-safety of parse_url
php_parse_url() is intended to support strings that are not zero
terminated. We can't use strcspn in the implementation.
As we have two uses of strcspn, add a helper.
Dmitry Stogov [Wed, 2 Sep 2020 14:31:48 +0000 (17:31 +0300)]
Micro-optimization
Frank Du [Wed, 2 Sep 2020 10:53:29 +0000 (10:53 +0000)]
X86: Fast CRC32 computation using PCLMULQDQ instruction
Based on:
"Fast CRC Computation for Generic Polynomials Using PCLMULQDQ Instruction"
V. Gopal, E. Ozturk, et al., 2009, http://intel.ly/2ySEwL0
Signed-off-by: Frank Du <frank.du@intel.com>
Closes GH-6018
Michael Voříšek [Wed, 2 Sep 2020 10:24:43 +0000 (12:24 +0200)]
Fix typo in test description
Closes GH-6062.
Dmitry Stogov [Wed, 2 Sep 2020 09:59:52 +0000 (12:59 +0300)]
Added missing helper
Dmitry Stogov [Wed, 2 Sep 2020 09:55:16 +0000 (12:55 +0300)]
Improved JIT for VERIFY_RETURN_TYPE
Máté Kocsis [Mon, 24 Aug 2020 18:42:29 +0000 (20:42 +0200)]
Move custom type checks to ZPP
Closes GH-6034
Nikita Popov [Wed, 2 Sep 2020 08:53:44 +0000 (10:53 +0200)]
Merge branch 'PHP-7.4'
* PHP-7.4:
Fix throwing of yield from related exceptions into generator
Nikita Popov [Wed, 2 Sep 2020 08:53:13 +0000 (10:53 +0200)]
Merge branch 'PHP-7.3' into PHP-7.4
* PHP-7.3:
Fix throwing of yield from related exceptions into generator
Nikita Popov [Wed, 2 Sep 2020 08:50:14 +0000 (10:50 +0200)]
Fix throwing of yield from related exceptions into generator
Use the general zend_generator_throw_exception() helper for this.
Otherwise we don't handle the off-by-one opline correctly (should
we maybe just stop doing that?)
This is a followup to
ad750c3bb6e7b48384c6265eb9d3bcf5b4000652 ,
which fixed a different yield from exception handling problem that
happened to show up in the same test case from oss-fuzz #25321.
Now both issues should be fixed.
Dmitry Stogov [Wed, 2 Sep 2020 08:49:42 +0000 (11:49 +0300)]
Minimal JIT support for JMP_NULL
Nikita Popov [Wed, 2 Sep 2020 08:23:44 +0000 (10:23 +0200)]
Fix by-ref list assign LIST_W+MAKE_REF separation
Shift the responsibility for emitting MAKE_REF to the list assignment
code, to make sure that LIST_W and MAKE_REF are directly adjacent,
and there are no opcodes in between that could modify the LIST_W
result.
Additionally, adjust the zend_wrong_string_offset() code to not
perform a loop over opcodes and assert that the next opcode is
a relevant one. The VM write-safety model requires this.
This is a followup to
a07c1f56aac1c0f6c8334760009b678cbf9d6138
and the full fix for oss-fuzz #25352.
Nikita Popov [Wed, 2 Sep 2020 08:16:46 +0000 (10:16 +0200)]
Merge branch 'PHP-7.4'
* PHP-7.4:
Fix infinite loop on string offset during by-ref list assign
Nikita Popov [Wed, 2 Sep 2020 08:16:35 +0000 (10:16 +0200)]
Merge branch 'PHP-7.3' into PHP-7.4
* PHP-7.3:
Fix infinite loop on string offset during by-ref list assign
Nikita Popov [Wed, 2 Sep 2020 08:13:42 +0000 (10:13 +0200)]
Fix infinite loop on string offset during by-ref list assign
There is a deeper underlying issue here, in that the opcodes violate
VM write-fetch safety, but let's fix the infinite loop first.
This fixes oss-fuzz #25352.
Dmitry Stogov [Tue, 1 Sep 2020 23:03:38 +0000 (02:03 +0300)]
Preallocate zval for unused result of internal function on CPU stack
Nikita Popov [Tue, 1 Sep 2020 18:35:33 +0000 (20:35 +0200)]
Disable ifunc resolvers under dataflow sanitizer
As with other sanitizers, this is not supported.
Nikita Popov [Tue, 1 Sep 2020 14:19:34 +0000 (16:19 +0200)]
Assert there are children in zend_generator_get_child()
Gabriel Caruso [Tue, 1 Sep 2020 17:19:26 +0000 (17:19 +0000)]
Update NEWS for 8.0.0rc1
Gabriel Caruso [Tue, 1 Sep 2020 17:08:27 +0000 (17:08 +0000)]
Update NEWS for PHP 8.0.0beta3
Levi Morrison [Tue, 1 Sep 2020 15:57:49 +0000 (09:57 -0600)]
Add zend_observer API
Closes GH-5857.
Co-authored-by: Nikita Popov <nikita.ppv@gmail.com>
Co-authored-by: Sammy Powers <sammyk@datadoghq.com>
Dmitry Stogov [Tue, 1 Sep 2020 15:56:47 +0000 (18:56 +0300)]
Eliminate useless EG(exception) checks aftr FE_RESET/FE_FETCH
Máté Kocsis [Fri, 14 Aug 2020 15:36:20 +0000 (17:36 +0200)]
Add more precise type info for stubs
Closes GH-6005
Dmitry Stogov [Tue, 1 Sep 2020 13:26:29 +0000 (16:26 +0300)]
Eliminate some EX_CALL_INFO() checks
Nikita Popov [Tue, 1 Sep 2020 13:17:28 +0000 (15:17 +0200)]
Merge branch 'PHP-7.4'
* PHP-7.4:
Check for null EX(func) in write_property
Nikita Popov [Tue, 1 Sep 2020 13:14:32 +0000 (15:14 +0200)]
Check for null EX(func) in write_property
This can happen if zend_call_function inserted a dummy frame,
and we already switched to the dummy frame in leave_helper,
and an exception is thrown during CV destruction.
Fixes oss-fuzz #25343.