1
0
mirror of https://github.com/php/php-src.git synced 2026-04-14 11:32:11 +02:00
Commit Graph

2843 Commits

Author SHA1 Message Date
Nikita Popov
b33697d47e Merge branch 'PHP-7.4'
* PHP-7.4:
  Fixed bug #79193
2020-01-30 14:56:31 +01:00
Nikita Popov
f70b552326 Fixed bug #79193 2020-01-30 14:55:58 +01:00
Tyson Andre
5f92a085cc Convert ZEND_ECHO operand to string after sccp
And filter out echoes of the empty string (e.g. false/null)

Split out of #5097 (on GitHub)

Closes GH-5118
2020-01-27 20:21:24 -05:00
Nikita Popov
ebd00c5b65 Merge branch 'PHP-7.4'
* PHP-7.4:
  Fixed bug #79128
2020-01-24 16:20:30 +01:00
Nikita Popov
3291891408 Fixed bug #79128
We need to extend the hash table before performing raw append
operations.

This doesn't matter if preloading happens in the same process,
as the tables will be large enough to hold all entries as a
side-effect of the preloading process. However, if preloading
happens in a different process, we need to reserve space here.
2020-01-24 16:18:48 +01:00
Xinchen Hui
ce5d722a6d Merge branch 'PHP-7.4'
* PHP-7.4:
  Let's make this safer from maliciously crafted filename
2020-01-20 12:35:08 +08:00
Xinchen Hui
2958cdc0b5 Let's make this safer from maliciously crafted filename 2020-01-20 12:33:37 +08:00
Xinchen Hui
5aa12d2e32 Merge branch 'PHP-7.4'
* PHP-7.4:
  minor cleanup
2020-01-20 12:29:23 +08:00
Xinchen Hui
dda2addab2 minor cleanup 2020-01-20 12:28:57 +08:00
Xinchen Hui
31dd635eb3 Merge branch 'PHP-7.4'
* PHP-7.4:
  Fixed bug #79114 (Eval class during preload causes class to be only half available)
2020-01-20 12:25:10 +08:00
Xinchen Hui
9c2fd55d01 Fixed bug #79114 (Eval class during preload causes class to be only half available) 2020-01-20 12:24:49 +08:00
Máté Kocsis
99db00b1f2 Fix #78880 Another round 2020-01-19 18:28:43 +01:00
Tyson Andre
3c72105edb Remove leftover ZEND_CAST code for (unset) cast.
Followup for d74d3922ce

Attempting to require a file with (unset) casts results in an E_COMPILE_ERROR
that can't be caught or handled by set_exception_handler/set_error_handler.

Also remove the (bool) cast, because the ZEND_BOOL opcode handles that.

Remove inference that array -> object cast can throw.
It was added in 2a286ad599 - I don't know how creating an stdClass would throw.
(numeric keys, references, etc. don't cause it to throw)

Closes GH-5042
2020-01-18 11:06:19 -05:00
Nikita Popov
9ec1ee5976 Add support for deprecating constants
Internal constants can be marked as CONST_DEPRECATED, in which
case accessing them will throw a deprecation warning.

For now this is only supported on global constants, not class
constants. Complain to me if you need to deprecate a class
constant...

Closes GH-5072.
2020-01-17 10:05:06 +01:00
Nikita Popov
43719022ea Improve SSA representation of FE_FETCH
The op2 of FE_FETCH is only written if the loop edge is taken.
Fix up the SSA form to use the pre-assignment value if the exit
edge is taken.

This allows us to properly infer the type of the loop variable,
without letting the pre-loop type leak in.

Closes GH-5040.
2020-01-17 09:41:27 +01:00
Nikita Popov
bd1977282c Use zend_type inside type lists
Instead of having a completely independent encoding for type list
entries. This is going to use more memory, but I'm not particularly
concerned about that, as type unions that contain multiple classes
should be uncommon. On the other hand, this allows us to treat
top-level types and types inside lists mostly the same.

A new ZEND_TYPE_FOREACH macros allows to transparently treat list
and non-list types the same way. I'm not using it everywhere it could be
used for now, just the places that seemed most obvious.

Of course, this will make any future type system changes much simpler,
as it will not be necessary to duplicate all logic two times.
2020-01-17 09:37:54 +01:00
Máté Kocsis
afdaa91170 Fix #78880: Final spelling fixes 2020-01-16 19:14:31 +01:00
Máté Kocsis
0b4778c377 Fix #78880: Another bunch of spelling errors 2020-01-16 09:46:47 +01:00
Dmitry Stogov
8ee04946f0 typo 2020-01-13 16:25:42 +03:00
Nikita Popov
862a4f3a5e Fix build 2020-01-13 12:42:51 +01:00
Dmitry Stogov
27815959e1 Improve access to zend_map_ptr data 2020-01-13 14:27:35 +03:00
George Peter Banyard
bfe3f934a3 Add warning and convert to exception in string offset assignment:
Convert the empty string assignment to an Error as per RFC [1]
Add a warning that only the first byte will be assigned to the offset if provided
a needle that is longer than one byte.

[1] https://wiki.php.net/rfc/engine_warnings
2020-01-07 21:54:42 +01:00
Nikita Popov
9b6c0bdcd6 Merge branch 'PHP-7.4'
* PHP-7.4:
  Remove support for preloading on Windows
2020-01-06 22:42:31 +01:00
Nikita Popov
59c3ddab13 Remove support for preloading on Windows
Due to ASLR restrictions, preloading on Windows does not work with
any code that has preloading dependencies on internal classes.
This effectively makes it unusable for any non-trivial codebase.

Instead of pretending like preloading is going to work, only to
make people realize that it really doesn't once they get beyond
a dummy example, we disable support for preloading on Windows
entirely.

Closes GH-4999.
2020-01-06 22:41:55 +01:00
Nikita Popov
8abb2ced39 Fixed bug #79055
Fix file cache serialization of property types. I'm changing the
overall type serialization format to perform additional adjustments
in order to yield a plausible pointer for zend_type, rather than
using an entirely separate serialization format, as was previously
done. That would have been annoying to extend to the case of CE
pointers.
2020-01-02 15:53:15 +01:00
Nikita Popov
48622970fb Extract functions for file cache type serialization
This is already done in master.
2020-01-02 15:16:24 +01:00
Nikita Popov
3bc4159a19 Merge branch 'PHP-7.4'
* PHP-7.4:
  Fix file cache run_time_cache unserialization
  Update ZCSG(map_ptr_last) only if for_shm
2020-01-02 15:01:56 +01:00
Nikita Popov
36d5fbbd6b Fix file cache run_time_cache unserialization
If the script was serialized as file_cache_only (thus non-immutable)
and then gets unserialized into SHM, we need to allocate a new
run_time_cache slot and can't use the serialized arena pointer.
2020-01-02 14:56:39 +01:00
Nikita Popov
e576d342bb Update ZCSG(map_ptr_last) only if for_shm
Otherwise we may get a memory protection fault here. Updating of
ZCSG(map_ptr_last) is handled when loading from file cache to SHM.
2020-01-02 11:59:36 +01:00
Máté Kocsis
345703724c Use RETURN_THROWS() during ZPP in most of the extensions
Except for some bigger ones: reflection, sodium, spl
2019-12-31 11:46:11 +01:00
Nikita Popov
3262c28d5c Merge branch 'PHP-7.4'
* PHP-7.4:
  Also propagate include exceptions in opcache
  Make url_stats in resolve_path quiet
2019-12-30 23:22:39 +01:00
Nikita Popov
22e9f9fe4d Also propagate include exceptions in opcache 2019-12-30 23:22:26 +01:00
Christoph M. Becker
e57b2b9465 Merge branch 'PHP-7.4'
* PHP-7.4:
  Fix #79040: Warning Opcode handlers are unusable due to ASLR
2019-12-30 15:18:25 +01:00
Christoph M. Becker
94063619a0 Merge branch 'PHP-7.3' into PHP-7.4
* PHP-7.3:
  Fix #79040: Warning Opcode handlers are unusable due to ASLR
2019-12-30 15:17:41 +01:00
Christoph M. Becker
0cecf83b26 Fix #79040: Warning Opcode handlers are unusable due to ASLR
We must not use the same shared memory OPcache instance for different
SAPIs, since their memory layout is different.  To avoid this, we add
the SAPI name (truncated to at most 20 characters) to the names of the
memory base file, the mutex and the file mapping.
2019-12-30 15:12:58 +01:00
Nikita Popov
6c6d36bb94 Fix SSA construction for ADD_ARRAY_ELEMENT in RC_INFERENCE mode
This was broken in cc29cbe80c.
2019-12-30 13:29:32 +01:00
Dmitry Stogov
7b69855bd0 Fixed type_info for new array element (it may be only NULL) 2019-12-26 16:32:45 +03:00
Dmitry Stogov
cc29cbe80c cleanup 2019-12-26 11:54:05 +03:00
Dmitry Stogov
e874811221 Build call graph before type inference 2019-12-24 16:15:24 +03:00
Dmitry Stogov
1e53769d82 Set opcode handler 2019-12-23 14:14:47 +03:00
Christoph M. Becker
dabc28d182 Fix #78880: Spelling error report
We fix the most often occuring typos according to a recent codespell
report[1] in tests, code comments and documentation.

[1] <https://fossies.org/linux/test/php-src-master-f8f48ce.191129.tar.gz/codespell.html>.
2019-12-21 11:58:00 +01:00
Máté Kocsis
d9eb97d745 Remove unnecessary FN type information from OPCache
GH-5029
2019-12-20 16:45:57 +01:00
Máté Kocsis
0e8070778e Make get_defined_vars() always return an array
GH-5025
2019-12-20 14:31:57 +01:00
Máté Kocsis
f52f471a5e Fix F1 type information in OPCache
Closes GH-5025
2019-12-20 14:31:30 +01:00
Nikita Popov
2bc0a6e97f Fix string offset signed int UB in jit as well 2019-12-20 12:11:07 +01:00
Máté Kocsis
bf645d6dc1 Remove unnecessary F0 type information from OPCache
Closes GH-5024
2019-12-20 12:03:08 +01:00
Nikita Popov
aadd5e69e0 Merge branch 'PHP-7.4'
* PHP-7.4:
  Fixed bug #78986
2019-12-18 11:41:11 +01:00
Nikita Popov
bd4fce4f6f Fixed bug #78986
Don't assume that handlers live in the arena, they may also be in
SHM.
2019-12-18 11:40:58 +01:00
Dmitry Stogov
b7e1eecd54 Avoid generation of "jmp" to next instruction 2019-12-17 15:42:02 +03:00
Dmitry Stogov
97bba4ffd6 Make "exception_handler_undef" stub to check EG(opline_before_exception) and undefine corresponnding result variable, if necessary.
This fixes few invalid "exception_handler_undef" usages.
2019-12-17 14:09:26 +03:00