Commit Graph

128286 Commits

Author SHA1 Message Date
Christoph M. Becker
dad5cb442d
Fix GH-8408: bug68547.phpt fails without multibyte support 2022-04-20 16:42:09 +02:00
Nikita Popov
8f02d7b7e4 Remove unnecessary bailout in fcall optimization
Even if we can't optimize the SEND_VAL_EX, there is no reason to
skip the INIT_FCALL/DO_FCALL optimizations, those should be entirely
orthogonal.
2022-04-18 18:30:36 +02:00
Nikita Popov
a8b6aea5a2 Remove unused macros 2022-04-18 18:24:52 +02:00
Nikita Popov
2aba4f8235 Merge branch 'PHP-8.1'
* PHP-8.1:
  Move check for named params in fcall optimization earlier
2022-04-18 18:22:04 +02:00
Nikita Popov
18b4e36df1 Move check for named params in fcall optimization earlier
I don't think this is strictly necessary, but I think it makes
sense to check this before interpreting opline->op2.num as an
argument number.

This also adds one more has_known_send_mode() check that I had
missed before.
2022-04-18 18:21:24 +02:00
Nikita Popov
4dc669a74d Merge branch 'PHP-8.1'
* PHP-8.1:
  Don't optimize trailing args for prototype fbc
2022-04-18 17:57:59 +02:00
Nikita Popov
11f950e77e Don't optimize trailing args for prototype fbc 2022-04-18 17:57:16 +02:00
Max Kellermann
d87ba95acd
sapi/*: move duplicate "--define" code to library 2022-04-18 16:52:08 +02:00
Nikita Popov
462dc9da6a Don't specify ce for MAY_BE_REF STATIC_PROP_FETCH
This is unlikely to matter in practice (due to the short lifetime),
but we should not specify a CE for a potential ref result.

Fixes oss-fuzz #46810.
2022-04-18 10:45:57 +02:00
Dmitry Stogov
dc374a0b22 Merge branch 'PHP-8.1'
* PHP-8.1:
  JIT: Fixed incorrect guard
2022-04-18 11:35:08 +03:00
Dmitry Stogov
c3a30544ad JIT: Fixed incorrect guard
Fixes oss-fuzz #46704
2022-04-18 11:34:18 +03:00
Dmitry Stogov
6ed3b57e67 Fix incorrect constant propagation for VERIFY_RETURN_TYPE
Fixes oss-fuzz #46616
2022-04-18 10:33:52 +03:00
Nikita Popov
fbb7393997 Handle other DO_FCALL opcodes in NEW live range calculation
Make this robust against the case where NEW is terminated by
something other than DO_FCALL, e.g. DO_UCALL. This can't currently
happen.
2022-04-17 22:56:23 +02:00
Nikita Popov
74c0edefe7 Remove unnecessary abstract function check in zend_get_call_op()
Abstract functions are now handled in the INIT stage, they do not
affect DO opcodes anymore.

Also add a check for another precondition, namely that the function
is not a trampoline.
2022-04-17 18:07:52 +02:00
Nikita Popov
df4c27642e Check opcode rather than result_type for R/IS type inference
We may sometimes create FETCH_*_R opcodes with VAR type (e.g. if a
FUNC_ARG opcode is converted to BP_VAR_R fetch kind). Make sure we
don't infer overly conservative types in that case.
2022-04-16 22:42:20 +02:00
Alex Dowad
3f12d26e3a Merge branch 'PHP-8.1'
* PHP-8.1:
  Error handling for UTF-8 complies with WHATWG specification
2022-04-16 20:32:12 +02:00
Alex Dowad
04e59c916f Error handling for UTF-8 complies with WHATWG specification
In 7502c86342, I adjusted the number of error markers emitted on
invalid UTF-8 text to be more consistent with mbstring's behavior on
other text encodings (generally, it emits one error marker for one
unexpected byte). I didn't expect that anybody would actually care one
way or the other, but felt that it was better to be consistent than
not.

Later, Martin Auswöger kindly pointed out that the WHATWG encoding
specification, which governs how various text encodings are handled
by web browsers, does actually specify how many error markers should
be generated for any given piece of invalid UTF-8 text.

Until now, we have never really paid much attention to the WHATWG
specification, but we do want to comply with as many relevant
specifications as possible. And since PHP is commonly used for web
applications, compatibility with the behavior of web browsers is
obviously a good thing.
2022-04-16 15:04:38 +02:00
Nikita Popov
4bd7f4e0ad Check that MAY_BE_REF variables cannot have a ce 2022-04-15 23:57:21 +02:00
Nikita Popov
701e10c3b9 Merge branch 'PHP-8.1'
* PHP-8.1:
  Don't set ce for by-ref return type
2022-04-15 23:56:04 +02:00
Nikita Popov
b0ab5d0fb0 Don't set ce for by-ref return type
For the case where we upgrade a prototype to a possible by-ref
return from an inheriting method.
2022-04-15 23:55:48 +02:00
Jakub Zelenka
1f0261a3e3 Merge branch 'PHP-8.1' 2022-04-15 22:21:50 +01:00
Jakub Zelenka
a57625374d Merge branch 'PHP-8.0' into PHP-8.1 2022-04-15 22:21:18 +01:00
David Carlier
2f0918c638
Fix FPM socket clean up reallocation clang build warning 2022-04-15 22:20:15 +01:00
David Carlier
fc9fecbd09
Fix FPM zlog warning with var being uninitialized 2022-04-15 22:19:36 +01:00
Nikita Popov
7408da7ac0 Merge branch 'PHP-8.1'
* PHP-8.1:
  Move MAY_BE_REF check into COPY_SSA_OBJ_TYPE
2022-04-15 23:15:06 +02:00
Nikita Popov
4026daee2b Merge branch 'PHP-8.0' into PHP-8.1
* PHP-8.0:
  Move MAY_BE_REF check into COPY_SSA_OBJ_TYPE
2022-04-15 23:14:59 +02:00
Nikita Popov
d16d251e20 Move MAY_BE_REF check into COPY_SSA_OBJ_TYPE
ZEND_ASSIGN is not the only place where this is relevant, so
handle it generically inside COPY_SSA_OBJ_TYPE instead.
2022-04-15 23:14:04 +02:00
Nikita Popov
01996d1534 Merge branch 'PHP-8.1'
* PHP-8.1:
  Don't use CE for by-ref arguments
2022-04-15 23:01:05 +02:00
Nikita Popov
38547b996a Merge branch 'PHP-8.0' into PHP-8.1
* PHP-8.0:
  Don't use CE for by-ref arguments
2022-04-15 23:00:59 +02:00
Nikita Popov
5d072578cd Don't use CE for by-ref arguments 2022-04-15 23:00:43 +02:00
Nikita Popov
bc24c62030 Merge branch 'PHP-8.1'
* PHP-8.1:
  Don't use CE info from pi node for MAY_BE_REF var
2022-04-15 22:39:13 +02:00
Nikita Popov
f1814e6a1f Merge branch 'PHP-8.0' into PHP-8.1
* PHP-8.0:
  Don't use CE info from pi node for MAY_BE_REF var
2022-04-15 22:37:29 +02:00
Nikita Popov
41f33b9dc3 Don't use CE info from pi node for MAY_BE_REF var
Once again, the actual class type may be reassigned indirectly.
2022-04-15 22:36:13 +02:00
David CARLIER
7be195caa7
Support fpm_get_socket_listening_queue on macOS
Using TCP_CONNECTION_INFO socket option.
2022-04-15 21:21:43 +01:00
Nikita Popov
838746bb4b Merge branch 'PHP-8.1'
* PHP-8.1:
  Fix inference for assignment of known object to reference
2022-04-15 22:15:57 +02:00
Nikita Popov
3fdb1aa14e Merge branch 'PHP-8.0' into PHP-8.1
* PHP-8.0:
  Fix inference for assignment of known object to reference
2022-04-15 22:15:32 +02:00
Nikita Popov
b08aac0451 Fix inference for assignment of known object to reference
We cannot retain the ce information in that case, we have to
assume the ce may change indirectly through the reference.

Fixes oss-fuzz #46720.
2022-04-15 22:14:44 +02:00
Christoph M. Becker
3de0ccfe09
Merge branch 'PHP-8.1'
* PHP-8.1:
  Fix GH-8366: ArrayIterator may leak when calling __construct()
2022-04-15 19:10:29 +02:00
Christoph M. Becker
549cf3a24d
Merge branch 'PHP-8.0' into PHP-8.1
* PHP-8.0:
  Fix GH-8366: ArrayIterator may leak when calling __construct()
2022-04-15 19:08:28 +02:00
Christoph M. Becker
1762a87932
Fix GH-8366: ArrayIterator may leak when calling __construct()
When we detach an iterator, we also have to delete it.

Closes GH-8374.
2022-04-15 19:05:18 +02:00
Anatol Belski
8de75fa754 fileinfo: Re-add Apple flag
It is not supported for all kinds of data, but it is definitely usable.

Signed-off-by: Anatol Belski <ab@php.net>
2022-04-15 14:44:50 +02:00
George Peter Banyard
8649cb8a96
Improve and fix stub return types (#8368) 2022-04-14 18:38:00 +01:00
Derick Rethans
731e3f6c96 Merge branch 'PHP-8.1' 2022-04-14 10:32:25 +01:00
Derick Rethans
ec0771c03f Merge branch 'PHP-8.0' into PHP-8.1 2022-04-14 10:32:21 +01:00
Derick Rethans
789f6b8367 Merged pull request #8175 2022-04-14 10:32:18 +01:00
Derick Rethans
e38d300a70 Refactor code to avoid duplication 2022-04-14 10:32:10 +01:00
Cody Mann
24085d0192 style/readability updates 2022-04-14 10:22:00 +01:00
Cody Mann
287c8a86b4 GH-7979: iterator advances when checking if valid 2022-04-14 10:22:00 +01:00
Ilija Tovilo
95898362a1
Merge branch 'PHP-8.1'
* PHP-8.1:
  Fix opcache testing in CI
2022-04-14 09:52:26 +02:00
Ilija Tovilo
d1dc71093f
Merge branch 'PHP-8.0' into PHP-8.1
* PHP-8.0:
  Fix opcache testing in CI
2022-04-14 09:52:07 +02:00