Commit graph

12767 commits

Author SHA1 Message Date
Nikita Popov
70eeafa326 Merge branch 'PHP-7.1' 2016-08-16 15:51:32 +02:00
Nikita Popov
ba09a520d2 Cleanup parameter/return type checking code
a) Extract all the logic for error message formatting into a separate
function that is reused for everything.
b) Extract the logic for whether a value matches a type into two
functions, one for user types, one for internal ones.

This tries to fight the increasing code duplication in the type
checking code, whether everything was repeated at least four times
and parts of the error message handling were repeated in dozens of
branches.
2016-08-16 15:48:33 +02:00
Nikita Popov
befca6a283 Merge branch 'PHP-7.1' 2016-08-16 12:43:46 +02:00
Nikita Popov
1397f754c8 Fix handling of qualified nullable parameter types
compile_typename() can't deal with TYPE_NULLABLE flags, drop it
beforehand.
2016-08-16 12:43:17 +02:00
Dmitry Stogov
ff06588130 Fixed use after free 2016-08-16 11:44:22 +03:00
Nikita Popov
89f6377971 Return true for is_object() on Incomplete_Class 2016-08-15 23:13:09 +02:00
Stanislav Malyshev
c2a13ced42 Fix bug #72742 - memory allocator fails to realloc small block to large one 2016-08-14 19:08:59 -07:00
Danack
0fbaf3c820 Add test. 2016-08-13 21:59:31 +01:00
Xinchen Hui
7ec53e8ff2 Merge branch 'PHP-7.1'
* PHP-7.1:
  Update NEWs
  Fixed bug #72813 (Segfault with __get returned by ref)
  Fix URL rewriter partially
2016-08-12 16:37:14 +08:00
Xinchen Hui
dd618664a0 Merge branch 'PHP-7.0' into PHP-7.1
* PHP-7.0:
  Fixed bug #72813 (Segfault with __get returned by ref)
  Fix URL rewriter partially

Conflicts:
	Zend/zend_object_handlers.c
	ext/standard/url_scanner_ex.c
	ext/standard/url_scanner_ex.re
2016-08-12 16:35:41 +08:00
Xinchen Hui
e03480bfab Fixed bug #72813 (Segfault with __get returned by ref)
This should be safe change, as we don't dereference value and member
after calling setter/getter.

And compare to adding unref codes, this is much cheaper.
2016-08-12 16:24:46 +08:00
Danack
86aa1c784d Require parameter to be an object if passed. 2016-08-11 23:21:04 +01:00
Nikita Popov
d4bbbc4aa6 Merge branch 'PHP-7.1' 2016-08-11 18:45:42 +02:00
Andrea Faulds
1dab96c1db Show "or null" in TypeErrors for nullable arg_infos 2016-08-11 18:44:43 +02:00
Nikita Popov
b6a69f239d Merge branch 'PHP-7.1' 2016-08-11 18:30:18 +02:00
Davey Shafik
b33e965111 Use non-deprecated %pure-parser 2016-08-11 18:29:55 +02:00
Joey
194ffefb9e Corrected typo in comment
Finger-key interface malfunction.
2016-08-11 18:28:50 +02:00
Nikita Popov
852a5ff23c Fix typos 2016-08-11 17:57:58 +02:00
Xinchen Hui
75017520c3 Check them in autoconf 2016-08-11 19:57:30 +08:00
Andrea Faulds
9bbbb1bd80 Use checked add/sub intrinsics instead of asm for ++ and -- 2016-08-10 00:46:05 +01:00
Andrea Faulds
0987737397 Use checked arithmetic intrinsics instead of asm, when possible 2016-08-10 00:46:05 +01:00
Andrea Faulds
863cdf627e Merge branch 'PHP-7.1' 2016-08-08 21:01:28 +01:00
Andrea Faulds
ab45f13a0b Merge branch 'PHP-7.0' into PHP-7.1 2016-08-08 21:00:49 +01:00
Andrea Faulds
5358c7cf5e Replace dead branch with ZEND_ASSERT() 2016-08-08 20:56:11 +01:00
Sara Golemon
9c3865eb6a [ast] Fix exporting **= in expansion of assign op 2016-08-06 15:35:45 -07:00
Nikita Popov
da2c2fb22f Merge branch 'PHP-7.1' 2016-08-05 19:56:48 +02:00
Nikita Popov
3859bcd1f8 Merge branch 'PHP-7.0' into PHP-7.1 2016-08-05 19:56:27 +02:00
Nikita Popov
807e81937b Fix bug #72767
The page size calculation did not account for the size of the
stack header (or rather it did account for it, but in the wrong
direction...)
2016-08-05 19:55:10 +02:00
Nikita Popov
372d0457b5 Merge branch 'PHP-7.1' 2016-08-03 23:10:29 +02:00
Nikita Popov
ec6d70db77 Fix leak on self-referencing constants 2016-08-03 23:10:09 +02:00
Anatol Belski
845f66ba64 increase versions for 7.2 2016-08-02 11:01:57 +02:00
Kalle Sommer Nielsen
bfba840e42 Fix build on Windows 2016-07-30 17:30:49 +02:00
Nikita Popov
ca82574d7c Fix invalid free on undef const in update_const()
Also clean up the control flow a bit -- move all unqualified
constant handling in one branch.
2016-07-30 00:37:01 +02:00
Nikita Popov
3b48c5a36f Revert "Make call_user_func() on reference args consistent"
This reverts commit fafe01b07b.

See bug #72698, there is code using this behavior. Reverting for
PHP 7.0 *only*. The fix is still in PHP 7.1.
2016-07-28 18:45:44 +02:00
Bob Weinand
dfb3e270c2 Merge remote-tracking branch 'origin/PHP-7.0' into PHP-7.1 2016-07-27 18:18:47 +02:00
Bob Weinand
5513f00a97 Fixed a potential segfault in zend_objects_store_free_object_storage()
Under the special circumstance where a garbage collected objects bucket slot was not reused until the end of the script, we get access into freed memory...
No test added as it usually is valgrind-only, and only sometimes when the memory happens to have changed (i.e. (GC_FLAGS(obj) & IS_OBJ_FREE_CALLED) == 0), it actually *may* segfault
2016-07-27 18:08:43 +02:00
Bob Weinand
35764e3579 Merge remote-tracking branch 'origin/PHP-7.0' into PHP-7.1 2016-07-23 16:40:02 +02:00
Bob Weinand
6046acf93e Fix ClosedGeneratorException possibly thrown into wrong scope 2016-07-23 16:39:21 +02:00
Nikita Popov
f4d1af7981 Fix build
Missed this occurrence...
2016-07-23 00:12:11 +02:00
Nikita Popov
07af6ba898 Make sure TOKEN_PARSE mode is thread safe
Introduce an on_event_context passed to the on_event hook. Use this
context to pass along the token array. Previously this was stored
in a non-tls global :/
2016-07-23 00:00:13 +02:00
Xinchen Hui
5296853fff Merge branch 'PHP-7.0'
* PHP-7.0:
  Fixed typo
2016-07-20 17:01:53 +08:00
Xinchen Hui
cbbe17fb53 Fixed typo 2016-07-20 17:01:42 +08:00
Xinchen Hui
9254f5d5d3 Merge branch 'PHP-7.0'
* PHP-7.0:
  Fixed bug #72629 (Caught exception assignment to variables ignores references).

Conflicts:
	main/php_version.h
2016-07-20 17:00:09 +08:00
Xinchen Hui
97c0b133c5 Fixed bug #72629 (Caught exception assignment to variables ignores references). 2016-07-20 16:59:14 +08:00
Anatol Belski
ab39b094d2 Merge branch 'PHP-7.0'
* PHP-7.0:
  Fix for bug #72513
2016-07-19 17:23:51 +02:00
Stanislav Malyshev
374ae8e9da Fix for bug #72513
This is applicable to 7 as well, but was somehow missing from the merge.
2016-07-19 17:18:24 +02:00
Stanislav Malyshev
4d0565b5ba Merge branch 'PHP-5.5' into PHP-5.6
* PHP-5.5:
  fix #72519, possible OOB using imagegif
  fix #72512, invalid read or write for palette image when invalid transparent index is used
  Apparently some envs miss SIZE_MAX
  Fix tests
  Fix bug #72618: NULL Pointer Dereference in exif_process_user_comment
  Partial fix for bug #72613 - do not treat negative returns from bz2 as size_t
  Fix bug #72606: heap-buffer-overflow (write) simplestring_addn simplestring.c
  Fix for bug #72558, Integer overflow error within _gdContributionsAlloc()
  Fix bug #72603: Out of bound read in exif_process_IFD_in_MAKERNOTE
  Fix bug #72562 - destroy var_hash properly
  Fix bug #72533 (locale_accept_from_http out-of-bounds access)
  Fix fir bug #72520
  Fix for bug #72513
  CS fix and comments with bug ID
  Fix for HTTP_PROXY issue.
  add tests for bug #72512
  Fixed bug #72512 gdImageTrueColorToPaletteBody allows arbitrary write/read access
  Fixed bug #72479 - same as #72434

Conflicts:
	ext/bz2/bz2.c
	main/SAPI.c
	main/php_variables.c
2016-07-19 00:53:08 -07:00
Stanislav Malyshev
1a88692692 Merge branch 'PHP-5.6.24' into PHP-5.6
* PHP-5.6.24:
  Fix for bug #72513
  5.6.24RC1

Conflicts:
	configure.in
	main/php_version.h
2016-07-19 00:51:27 -07:00
Nikita Popov
cbba1fff3f Fix leak if get_iterator throws but doesn't return NULL 2016-07-16 23:16:34 +02:00
Nikita Popov
0242845536 Merge branch 'PHP-7.0' 2016-07-16 23:03:01 +02:00