Skip to content

Commit 2e19ccc

Browse files
committed
Merge branch 'PHP-5.4'
* PHP-5.4: Revert "- Fixed bug #61418 (Segmentation fault when DirectoryIterator's or" - causes bug #61482 update for git
2 parents 3efc9f2 + bcc15b5 commit 2e19ccc

File tree

3 files changed

+27
-75
lines changed

3 files changed

+27
-75
lines changed

Diff for: README.RELEASE_PROCESS

+12-20
Original file line numberDiff line numberDiff line change
@@ -50,38 +50,30 @@ Rolling a non stable release (alpha/beta/RC)
5050
2. run the "scripts/dev/credits" script in php-src and commit the changes in the
5151
credits files in ext/standard.
5252

53-
3. Bump the version numbers in ``main/php_version.h``, ``configure.in`` and possibly ``NEWS``.
54-
Do not use abbreviations for alpha and beta.
55-
56-
4. Commit those changes and note the revision id.
57-
58-
5. tag the repository with the version. To do the tag in a fast way do a svn copy on the server using full URLs. You should use the revision id from the above commit to prevent mistakes in case there was a commit in between. f.e. "``svn cp https://svn.php.net/repository/php/php-src/branches/PHP_5_3@308399 https://svn.php.net/repository/php/php-src/tags/php_5_3_6RC1``"
59-
(of course, you need to change that to the version you're rolling an RC for). Mail php-internals to announce the tag so tests/validation/check can be done prior to package it. It is especially important for RCs.
53+
3. Checkout the release branch for this release (e.g., PHP-5.4.2).
6054

61-
6. Bump up the version numbers in ``main/php_version.h``, ``configure.in``
62-
and possibly ``NEWS`` again, to the **next** version. F.e. if the release
63-
candidate was "4.4.1RC1" then the new one should be "4.4.1RC2-dev" - regardless
64-
if we get a new RC or not. This is to make sure ``version_compare()`` can
65-
correctly work.
55+
4. Bump the version numbers in ``main/php_version.h``, ``configure.in`` and possibly ``NEWS``.
56+
Do not use abbreviations for alpha and beta.
6657

67-
7. Commit those changes
58+
5. Commit these changes to the branch with ``git commit -a``.
6859

69-
8. Log in onto the snaps box and go into the correct tree (f.e. the PHP_4_4
70-
branch if you're rolling 4.4.x releases).
60+
6. Tag the repository with the version, e.g.:
61+
``git tag -u YOURKEYID PHP-5.4.2-RC2``
7162

72-
9. You do not have to update the tree, but of course you can with "``svn up``".
63+
7. Push the changes to the main repo:
64+
``git push --tags origin HEAD``
7365

74-
10. run: ``./makedist php 4.4.1RC1``, this will export the tree, create configure
66+
8. run: ``./makedist 5.4.2-RC2``, this will export the tree, create configure
7567
and build two tarballs (one gz and one bz2).
7668

77-
11. Copy those two tarballs to www.php.net, in your homedir there should be a
69+
9. Copy those two tarballs to www.php.net, in your homedir there should be a
7870
directory "downloads/". Copy them into there, so that the system can generate
7971
MD5 sums. If you do not have this directory, talk to Derick.
8072

81-
12. Now the RC can be found on http://downloads.php.net/yourname,
73+
10. Now the RC can be found on http://downloads.php.net/yourname,
8274
f.e. http://downloads.php.net/derick/
8375

84-
13. Once the release has been tagged, contact the PHP Windows development team
76+
11. Once the release has been tagged, contact the PHP Windows development team
8577
([email protected]) so that Windows binaries can be created. Once
8678
those are made, they should be placed into the same directory as the source snapshots.
8779

Diff for: ext/spl/spl_directory.c

+15-32
Original file line numberDiff line numberDiff line change
@@ -120,16 +120,6 @@ static void spl_filesystem_object_free_storage(void *object TSRMLS_DC) /* {{{ */
120120
spl_filesystem_file_free_line(intern TSRMLS_CC);
121121
break;
122122
}
123-
124-
{
125-
zend_object_iterator *iterator;
126-
iterator = (zend_object_iterator*)
127-
spl_filesystem_object_to_iterator(intern);
128-
if (iterator->data != NULL) {
129-
iterator->data = NULL;
130-
iterator->funcs->dtor(iterator TSRMLS_CC);
131-
}
132-
}
133123
efree(object);
134124
} /* }}} */
135125

@@ -1648,15 +1638,10 @@ zend_object_iterator *spl_filesystem_dir_get_iterator(zend_class_entry *ce, zval
16481638
dir_object = (spl_filesystem_object*)zend_object_store_get_object(object TSRMLS_CC);
16491639
iterator = spl_filesystem_object_to_iterator(dir_object);
16501640

1651-
/* initialize iterator if it wasn't gotten before */
1652-
if (iterator->intern.data == NULL) {
1653-
iterator->intern.data = object;
1654-
iterator->intern.funcs = &spl_filesystem_dir_it_funcs;
1655-
/* ->current must be initialized; rewind doesn't set it and valid
1656-
* doesn't check whether it's set */
1657-
iterator->current = object;
1658-
}
1659-
zval_add_ref(&object);
1641+
Z_SET_REFCOUNT_P(object, Z_REFCOUNT_P(object) + 2);
1642+
iterator->intern.data = (void*)object;
1643+
iterator->intern.funcs = &spl_filesystem_dir_it_funcs;
1644+
iterator->current = object;
16601645

16611646
return (zend_object_iterator*)iterator;
16621647
}
@@ -1735,15 +1720,15 @@ static void spl_filesystem_dir_it_rewind(zend_object_iterator *iter TSRMLS_DC)
17351720
static void spl_filesystem_tree_it_dtor(zend_object_iterator *iter TSRMLS_DC)
17361721
{
17371722
spl_filesystem_iterator *iterator = (spl_filesystem_iterator *)iter;
1723+
zval *zfree = (zval*)iterator->intern.data;
17381724

1739-
if (iterator->intern.data) {
1740-
zval *object = iterator->intern.data;
1741-
zval_ptr_dtor(&object);
1742-
} else {
1743-
if (iterator->current) {
1744-
zval_ptr_dtor(&iterator->current);
1745-
}
1725+
if (iterator->current) {
1726+
zval_ptr_dtor(&iterator->current);
17461727
}
1728+
iterator->intern.data = NULL; /* mark as unused */
1729+
/* free twice as we add ref twice */
1730+
zval_ptr_dtor(&zfree);
1731+
zval_ptr_dtor(&zfree);
17471732
}
17481733
/* }}} */
17491734

@@ -1854,12 +1839,10 @@ zend_object_iterator *spl_filesystem_tree_get_iterator(zend_class_entry *ce, zva
18541839
dir_object = (spl_filesystem_object*)zend_object_store_get_object(object TSRMLS_CC);
18551840
iterator = spl_filesystem_object_to_iterator(dir_object);
18561841

1857-
/* initialize iterator if wasn't gotten before */
1858-
if (iterator->intern.data == NULL) {
1859-
iterator->intern.data = object;
1860-
iterator->intern.funcs = &spl_filesystem_tree_it_funcs;
1861-
}
1862-
zval_add_ref(&object);
1842+
Z_SET_REFCOUNT_P(object, Z_REFCOUNT_P(object) + 2);
1843+
iterator->intern.data = (void*)object;
1844+
iterator->intern.funcs = &spl_filesystem_tree_it_funcs;
1845+
iterator->current = NULL;
18631846

18641847
return (zend_object_iterator*)iterator;
18651848
}

Diff for: ext/spl/tests/bug61418.phpt

-23
This file was deleted.

0 commit comments

Comments
 (0)