CHU Zhaowei
b15189f4d8
Fix #77298 : segfault occurs when add property to unserialized empty ArrayObject
2018-12-21 17:45:52 +01:00
Dmitry Stogov
0f7f1498be
Use ZEND_THIS macro to hide implementation details in extensions code.
2018-11-15 19:54:19 +03:00
Dmitry Stogov
c6ad0b92b7
Replace getThis() by EX(This), when additional check is not necessary.
2018-11-14 02:44:25 +03:00
Dmitry Stogov
3575a2b8f9
Micro optimizations
2018-10-17 16:55:52 +03:00
Nikita Popov
0b6063f331
Restore array_key_exists() compatibility for ArrayObject
...
Doing this by special-casing array_key_exists() for ArrayObject.
2018-10-11 16:10:22 +02:00
Nikita Popov
0697d83383
More straightforward count() on ArrayObject with object
...
Just writing this out as an explicit loop is both simpler and faster
than going through the entire positioning machinery.
2018-10-11 15:23:05 +02:00
Nikita Popov
5659035ab6
Remove unnecessary get_hash_table return value checks
...
An ArrayObject always has a valid backing hashtable, this function
can never return NULL.
2018-10-11 15:06:11 +02:00
Nikita Popov
a5fa51afbb
Don't overload get_properties for ArrayObject
...
Instead overload get_properties_for for a few specific cases such
as array casts. This resolves the issue where ArrayObject
get_properties may violate engine invariants in some cases.
2018-10-10 10:39:10 +02:00
Dmitry Stogov
c42f0ba4f7
Removed useless IS_UNDEF checks
2018-07-31 12:23:46 +03:00
Peter Kokot
8d3f8ca12a
Remove unused Git attributes ident
...
The $Id$ keywords were used in Subversion where they can be substituted
with filename, last revision number change, last changed date, and last
user who changed it.
In Git this functionality is different and can be done with Git attribute
ident. These need to be defined manually for each file in the
.gitattributes file and are afterwards replaced with 40-character
hexadecimal blob object name which is based only on the particular file
contents.
This patch simplifies handling of $Id$ keywords by removing them since
they are not used anymore.
2018-07-25 00:53:25 +02:00
Xinchen Hui
1638a6e118
Give a meaningful name
2018-07-24 12:51:36 +08:00
Dmitry Stogov
7d4e18b05d
Improved user iterator implementation to reduce zend_class_entry memory consumption and avoid race condition during resolving/caching of user iterator functions of internal classes in ZTS build.
2018-07-12 14:04:14 +03:00
Dmitry Stogov
67b4c3379a
Uze ZVAL_COPY_DEREF() instead of ZVAL_DEREF() and ZVAL_COPY()
2018-07-09 12:46:46 +03:00
Dmitry Stogov
f2b4ec4bdc
Export standard object handlers, to avoid indirect access
2018-05-31 11:57:22 +03:00
Dmitry Stogov
d90c6f2443
Removed useless zval_ptr_dtor()
2018-05-29 17:58:06 +03:00
Dmitry Stogov
5eb1f92f31
Use zend_string_release_ex() instread of zend_string_release() in places, where we sure about string persistence.
2018-05-28 16:27:12 +03:00
Xinchen Hui
0aff0548cb
Merge branch 'PHP-7.2'
...
* PHP-7.2:
Update NEWS
Fixed bug #76367 (NoRewindIterator segfault 11)
2018-05-23 14:46:32 +08:00
Xinchen Hui
dc461d6f56
Merge branch 'PHP-7.1' into PHP-7.2
...
* PHP-7.1:
Fixed bug #76367 (NoRewindIterator segfault 11)
2018-05-23 14:46:01 +08:00
Xinchen Hui
8f221bdec0
Fixed bug #76367 (NoRewindIterator segfault 11)
2018-05-23 14:45:38 +08:00
Joe Watkins
f37e95a443
Merge branch 'PHP-7.2'
...
* PHP-7.2:
Fix #76131 some arginfo params are different from the documentation
2018-03-27 22:00:31 +02:00
Joe Watkins
3e267ca91b
Merge branch 'PHP-7.1' into PHP-7.2
...
* PHP-7.1:
Fix #76131 some arginfo params are different from the documentation
2018-03-27 21:58:24 +02:00
Gabriel Caruso
63934ea71e
Fix #76131 some arginfo params are different from the documentation
2018-03-27 21:56:46 +02:00
Dmitry Stogov
d7f2dc4ec6
Improve HashTable iterators handling:
...
- Avoid iterators check/update on each HashTable update opration
- Keep position equal (or above) nNumUsed instead of HT_INVALID_IDX
- Fixed iterators handling in array_unshift()
2018-03-22 02:41:49 +03:00
Gabriel Caruso
701437a948
Remove return types from some magic method in protos
...
__construct, __destruct, __wakeup does not have return types defined.
2018-03-09 12:04:46 +01:00
Nikita Popov
ede663f381
Convert iterator by reference errors to exceptions
...
I'm using RuntimeException in SPL, because other SPL classes that
throw this error used it. Error is used for everything else, because
that's what core does.
2018-02-19 21:58:56 +01:00
Dmitry Stogov
6634d5e313
Use HT_FLAGS() macro
2018-01-22 14:58:16 +03:00
Dmitry Stogov
5f349f3ab8
Avoid useless duplication
2018-01-19 13:14:15 +03:00
Xinchen Hui
a6519d0514
year++
2018-01-02 12:57:58 +08:00
Xinchen Hui
7a7ec01a49
year++
2018-01-02 12:55:14 +08:00
Xinchen Hui
ccd4716ec7
year++
2018-01-02 12:53:31 +08:00
Nikita Popov
26207101c5
Merge branch 'PHP-7.2'
2017-12-22 18:22:52 +01:00
Nikita Popov
12e991f5bd
Merge branch 'PHP-7.1' into PHP-7.2
2017-12-22 18:22:47 +01:00
Nikita Popov
f14b6f4920
Fixed bug #73209
2017-12-22 18:22:00 +01:00
Nikita Popov
d90797a896
Merge branch 'PHP-7.2'
2017-12-22 18:12:23 +01:00
Nikita Popov
2c880037f5
Merge branch 'PHP-7.1' into PHP-7.2
2017-12-22 18:12:17 +01:00
Nikita Popov
ec142f2c86
Fixed bug #75242
2017-12-22 18:11:38 +01:00
Nikita Popov
9fe0eb8c48
Merge branch 'PHP-7.2'
2017-12-22 18:01:53 +01:00
Nikita Popov
74e3da5c8c
Merge branch 'PHP-7.1' into PHP-7.2
2017-12-22 18:01:30 +01:00
Nikita Popov
ccb113c3e5
Fixed bug #75717
2017-12-22 18:01:03 +01:00
Dmitry Stogov
1db8402208
Move zend_object_iterator_funcs structures into read-only data segment
2017-12-14 14:21:22 +03:00
Nikita Popov
b72b1a4e4d
Add zend_object_alloc() API
...
Using ecalloc() to create objects is expensive, because the
dynamic-size memset() is unreasonably slow. Make sure we only
zero the main object structure with known size, as the properties
are intialized separately anyway.
Technically we do not need to zero the embedded zend_object
structure either, but as long as the memset argument is constant,
a couple more bytes don't really matter.
2017-11-25 17:12:37 +01:00
Xinchen Hui
d56a534acc
RC manipulation cleanup 2
2017-11-02 12:13:35 +08:00
Dmitry Stogov
49ea143bbd
Encapsulate reference-counting primitives.
...
Prohibit direct update of GC_REFCOUNT(), GC_SET_REFCOUNT(), GC_ADDREF() and GC_DELREF() shoukf be instead.
Added mactros to validate reference-counting (disabled for now).
These macros are going to be used to eliminate race-condintions during reference-counting on data shared between threads.
2017-10-27 01:28:58 +03:00
Dmitry Stogov
44e0b79ac6
Refactored array creation API. array_init() and array_init_size() are converted into macros calling zend_new_array(). They are not functions anymore and don't return any values.
2017-09-20 02:25:56 +03:00
Nikita Popov
a624ded4d3
Merge branch 'PHP-7.1' into PHP-7.2
2017-07-18 22:16:33 +02:00
Nikita Popov
8e7c99acf4
Merge branch 'PHP-7.0' into PHP-7.1
2017-07-18 22:16:11 +02:00
andrewnester
afc22828ea
Fixed #74699 - Broken ArrayIterator unserializing
2017-07-18 22:14:11 +02:00
Tyson Andre
96fe07e006
Fixes Bug #71412 Incorrect ArrayIterator __construct signature
...
ArrayIterator doesn't have a getIterator method(), or an iterator setter,
and I don't think it makes sense for it to have one.
2017-07-02 10:37:28 -04:00
Xinchen Hui
9f263c257a
Merge branch 'PHP-7.0' into PHP-7.1
...
* PHP-7.0:
Fixed bug #74218 (ArrayIterator error message is confusing)
2017-03-10 15:16:01 +08:00
Xinchen Hui
c398198c0a
Fixed bug #74218 (ArrayIterator error message is confusing)
2017-03-10 15:15:31 +08:00