diff options
author | sj-i <shinji.igarashi@gmail.com> | 2021-01-12 14:06:52 +0900 |
---|---|---|
committer | Nikita Popov <nikita.ppv@gmail.com> | 2021-01-14 09:50:00 +0100 |
commit | 37b94ac38adf899930ffcc98df10634173b80204 (patch) | |
tree | 50965cc079c05d9483ed23cf8fe3867816d56271 /ext/intl/timezone/timezone_methods.cpp | |
parent | 924ec324260f54d9cd79d6a016cd067454c1d00a (diff) | |
download | php-git-37b94ac38adf899930ffcc98df10634173b80204.tar.gz |
Fix #51758: delete an outdated comment from zend_object_handler.h [ci skip]
The same description was originally written in a commit in 2004 which fixes a bug in the pre-released simplexml.
https://github.com/php/php-src/commit/c8c0e979826b677de5f786920289056242ea5c54
One requested to put the description in somewhere.
https://externals.io/message/7789
Then it was added as a comment in zend_object_handler.h .
https://github.com/php/php-src/commit/7d3215d33321173c58db4d86b7398e16c5c55d13
At the time of the comment written, the refcount of RHS was simply incremented before calling the write handler in the process of ZEND_ASSIGN_OBJ.
https://github.com/php/php-src/blob/c8c0e979826b677de5f786920289056242ea5c54/Zend/zend_execute.c#L407
The refcount of a zval may be 0 or 1 if the write handler is called from zend_API in that era.
https://github.com/php/php-src/blob/c8c0e979826b677de5f786920289056242ea5c54/Zend/zend_API.c#L1058-L1170
The original fix in simplexml was removed in 2018, because scalar types don't have reference counter anymore as of PHP7.
https://github.com/php/php-src/commit/f7f790fcc9d57bcd0b6d356994c67ec746a5ac23
https://github.com/php/php-src/commit/4a475a4976db92e71949786cdf5990c61514261e
It seems that the original intent of this prescription was preventing unintended modification to the RHS and values which share the memory location with the RHS in assignments.
In the first place, it is not usual trying to change the RHS in a write handler, IMHO. I don't think the description makes sense in the current situation about handling of refcount, so I simply delete the whole sentences.
Because write_dimension has no return value, the mentioning about the return value is moved to the comment for write_property only.
Closes GH-6597.
Diffstat (limited to 'ext/intl/timezone/timezone_methods.cpp')
0 files changed, 0 insertions, 0 deletions