1
0
mirror of https://github.com/php/php-src.git synced 2026-04-21 06:51:18 +02:00
Commit Graph

55371 Commits

Author SHA1 Message Date
Máté Kocsis
b516566b84 Convert CURL resources to objects
Closes GH-5402

Co-authored-by: Nikita Popov <nikita.ppv@gmail.com>
2020-06-17 16:11:57 +02:00
Sara Golemon
1e095e3412 Update CREDITS 2020-06-17 13:04:01 +00:00
Dmitry Stogov
18347758d7 Improved JIT for SEPARATE_ARRAY 2020-06-17 14:45:25 +03:00
Dmitry Stogov
3830855a65 Tracing JIT support for PHP references in ASSIGN instruction 2020-06-17 12:24:51 +03:00
Nikita Popov
5aa649cf51 Merge branch 'PHP-7.4' 2020-06-17 09:35:19 +02:00
Nikita Popov
3d6199db8a Add mbregex skipif 2020-06-17 09:35:02 +02:00
Dmitry Stogov
93aaf68088 cleanup 2020-06-17 10:32:53 +03:00
Christoph M. Becker
92c4b06513 Use ZEND_UNREACHABLE() instead of ZEND_ASSERT(0)
Instead of marking unreachable code with `ZEND_ASSERT(0)`, we introduce
`ZEND_UNREACHABLE()`, so that MSVC which does not consider `assert(0)`
to mark unreachable code does no longer trigger C4715[1] warnings in
debug builds.  This may be useful for other compilers as well.

[1] <https://docs.microsoft.com/de-de/cpp/error-messages/compiler-warnings/compiler-warning-level-1-c4715?view=vs-2019>
2020-06-16 18:39:09 +02:00
Dmitry Stogov
9ff3230c20 Merge exit points 2020-06-16 19:20:08 +03:00
Dmitry Stogov
626ccc45e4 Eliminate a dead check 2020-06-16 19:05:35 +03:00
Dmitry Stogov
8425214c1d Tracing JIT support for PHP references in array related instructions 2020-06-16 17:59:04 +03:00
Máté Kocsis
2e18b30d44 Convert resource to object in Sysvshm extension
Closes GH-5499
2020-06-16 16:36:11 +02:00
Christoph M. Becker
aa754ba85e FR #79344: xmlwriter_write_attribute_ns: $prefix should be nullable
The `$prefix` parameter of `xmlwriter_write_element_ns()` and
`xmlwriter_start_element_ns()` is nullable, what allows these functions
to be used instead of their non NS variants.  Consequently, we make the
`$prefix` parameter of `xmlwriter_write_attribute_ns()` and
`xmlwriter_start_attribute_ns()` nullable as well.
2020-06-16 15:50:01 +02:00
Nikita Popov
2c207ebe6b Remove debug code from usleep()
This was added to debug CI failures, but ultimately didn't help
understand the macos timing issues. Drop it now so it's not
forgotten...
2020-06-16 14:51:58 +02:00
Nikita Popov
bbe74a6e3a Merge branch 'PHP-7.4' 2020-06-16 14:32:33 +02:00
Nikita Popov
3f2f36d5d4 Fix non-default syntax in mb_ereg_search() 2020-06-16 14:31:29 +02:00
Dmitry Stogov
77d0587fdb Use "lea" to add/sub register with constant 2020-06-16 14:04:05 +03:00
Dmitry Stogov
a459799910 Improved JIT for ZVAL_COPY_DEREF 2020-06-16 13:24:28 +03:00
David Carlier
15b2cc7c28 Implements an openpty wrapper for solaris based systems
This is only used by proc_open pty support, and as such declared
directly there.
2020-06-16 11:19:00 +02:00
David Carlier
727ae51a0c Fix JIT build on solaris/illumos
thr_self to detect the proper thread identifier but all
related typedef'd types conflict with the vtune part.
2020-06-16 11:18:50 +02:00
Nikita Popov
8b822afb0c Fix printf type 2020-06-16 10:57:29 +02:00
Jens de Nies
01be55fc00 Made sure zpp is always called and refactored some existing zpp calls.
Closes GH-5714
2020-06-16 10:45:14 +02:00
Jens de Nies
58a65c4b96 Fixed some oci8 tests.
Closes GH-5716
2020-06-16 10:38:06 +02:00
Dmitry Stogov
bdd8406372 Added JIT debug flag to dump the size of generated code (opcache.jit_debug=0x200) 2020-06-16 11:27:34 +03:00
Dmitry Stogov
a92022f878 Fixed JIT 2020-06-15 15:35:02 +03:00
Dmitry Stogov
bb3d4456ee Change GC_COLLECTABLE flag into GC_NOT_COLLECTABLE to simplify GC_MAY_LEAK() check 2020-06-15 14:26:22 +03:00
Dmitry Stogov
18f2ef094a FETCH_FIM_R/IS JIT improvement 2020-06-15 12:15:56 +03:00
Christoph M. Becker
63cb47a86b Merge branch 'PHP-7.4'
* PHP-7.4:
  Fix #79687: Sony picture - PHP Warning - Make, Model, MakerNotes
2020-06-13 18:33:17 +02:00
Christoph M. Becker
59e343c779 Merge branch 'PHP-7.3' into PHP-7.4
* PHP-7.3:
  Fix #79687: Sony picture - PHP Warning - Make, Model, MakerNotes
2020-06-13 18:32:15 +02:00
Christoph M. Becker
5621c5faf8 Fix #79687: Sony picture - PHP Warning - Make, Model, MakerNotes
Even if the length of a maker note does not match our expectations
(either because the maker note is corrupted, or because our
expectations do not quite match reality), there is no need to let
parsing fail; we can still go on parsing the other meta information.
2020-06-13 18:30:57 +02:00
Máté Kocsis
793823655e Fix ZPP of OCI_Lob::free 2020-06-13 10:53:49 +02:00
Christoph M. Becker
b7a55aaff2 Merge branch 'PHP-7.4'
* PHP-7.4:
  Fix #79676: imagescale adds black border with IMG_BICUBIC
2020-06-12 14:09:16 +02:00
Christoph M. Becker
ff7fd3dc85 Merge branch 'PHP-7.3' into PHP-7.4
* PHP-7.3:
  Fix #79676: imagescale adds black border with IMG_BICUBIC
2020-06-12 14:07:43 +02:00
Christoph M. Becker
86e1f0ea11 Fix #79676: imagescale adds black border with IMG_BICUBIC
We have to loop over all image pixels to avoid the black border.  This
is also done in external libgd in `_gdScaleOneAxis` and `_gdScalePass`.
2020-06-12 14:05:54 +02:00
Nikita Popov
4f9a1122e1 Avoid out of range float to int cast in exif
Use convert_any_int instead of convert_any_format to directly get
an integer.

Also adjust SRATIONAL handling to not go through a double division.
This was introduced to avoid SIGFPE for the INT_MIN / -1 case,
but we can just handle that explicitly.
2020-06-12 12:54:41 +02:00
Nikita Popov
09532a12a6 Suppress deprecation warning in sockets.c
This one was quite a journey...
2020-06-12 12:35:02 +02:00
Nikita Popov
2ba10ad0c5 Revert accidental change
Not sure how this happened, but I seem to have reverted
2fd278bc21
as part of
1386850838.

Restore the change.
2020-06-12 11:34:01 +02:00
Nikita Popov
88021ffe0e Fix count_commas implementation
Ooops, I did not account for the changing length here.
2020-06-12 11:04:35 +02:00
Nikita Popov
f68a64a8a8 Fix null pointer UB in add_assoc_image_info()
And clean up this function a bit by reducing indentation and
variable scope.
2020-06-12 10:56:54 +02:00
Nikita Popov
ece375052b Fix float conversion warning
We are okay with the loss of precision here...
2020-06-12 10:20:10 +02:00
Nikita Popov
1386850838 Use unused attribute for _dummy
The (void)_dummy is apparently considered a read of an uninitialized
variable. As it is a _Bool now, which has trap representations, this
is no longer considered legal and results in somewhat odd ubsan
warnings of the form:

runtime error: load of value 0, which is not a valid value for type 'zend_bool' (aka 'bool')
2020-06-12 10:18:19 +02:00
Nikita Popov
f691693ebc Fix null pointer ub in encoding parsing
And do a bit of drive-by cleanup by extracting count_commas and
reducing some variable scopes.
2020-06-12 10:08:34 +02:00
Anatol Belski
a5e9950c7a Merge branch 'PHP-7.4'
* PHP-7.4:
  sqlite3: Fix possible use after free
2020-06-11 13:23:35 +02:00
Anatol Belski
2fd278bc21 sqlite3: Fix possible use after free
Exception should be thrown before the db handle is destroyed.
The backtrace excerpt

==26628== Invalid read of size 4
==26628==    at 0x53C49E3: sqlite3_errmsg (in /usr/lib64/libsqlite3.so.0.8.6)
==26628==    by 0x38C4E9: zim_sqlite3_open (sqlite3.c:142)
==26628==    by 0x8977BF: ZEND_DO_FCALL_SPEC_RETVAL_UNUSED_HANDLER (zend_vm_execute.h:1618)
==26628==    by 0x8F801E: execute_ex (zend_vm_execute.h:53824)
==26628==    by 0x8FC0BB: zend_execute (zend_vm_execute.h:57920)
==26628==    by 0x828F54: zend_execute_scripts (zend.c:1672)
==26628==    by 0x793C2C: php_execute_script (main.c:2621)
==26628==    by 0x8FEA44: do_cli (php_cli.c:964)
==26628==    by 0x8FF9DC: main (php_cli.c:1359)

Signed-off-by: Anatol Belski <ab@php.net>
2020-06-11 13:12:10 +02:00
Dmitry Stogov
217f6e16d6 Use cheaper variant of zend_hash_index_find() 2020-06-11 01:34:55 +03:00
Christoph M. Becker
08858e7cca Fix #73529: session_decode() silently fails on wrong input
The `php_serialize` decode function has to return `FAILURE`, if the
unserialization failed on anything but an empty string.

The `php` decode function has also to return `FAILURE`, if there is
trailing garbage in the string.
2020-06-10 16:48:49 +02:00
Christoph M. Becker
0eaecb9c87 Merge branch 'PHP-7.4'
* PHP-7.4:
  Fix #79681: mime_content_type/finfo returning incorrect mimetype
2020-06-10 16:40:39 +02:00
Christoph M. Becker
6747068ce7 Fix #79681: mime_content_type/finfo returning incorrect mimetype
We backport the respective fix for MP3s[1].

[1] <5a55569a35>
2020-06-10 16:36:40 +02:00
Nikita Popov
94df2f697f Fix bug #65006
The "callable name" may be the same for multiple distinct callables.
The code already worked around this for the case of instance methods,
but there are other cases in which callable names clash, such as
the use of self:: reported in the referenced bug.

Rather than trying to generate a unique name for callables, compare
the content of the alfi structures. This is less efficient if there
are many autoload functions, but autoload *registration* does not
need to be particularly efficient.

As a side-effect, this no longer permits unregistering non-callables.
2020-06-10 11:30:32 +02:00
Nikita Popov
034741f6c7 Simplify spl_autoload_perform() implementation
And convert alfi.obj from zval to zend_object*.
2020-06-10 10:33:54 +02:00