summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDmitry Stogov <dmitry@zend.com>2017-12-14 14:21:22 +0300
committerDmitry Stogov <dmitry@zend.com>2017-12-14 14:21:22 +0300
commit1db8402208055ac4fc00ef16dc1a7c2ec097849c (patch)
tree75c6765815ebfe54ba59bb5c2f323dce4650b7ba
parent175e461369efefc087f23fcba789c1c6cb1ee46a (diff)
downloadphp-git-1db8402208055ac4fc00ef16dc1a7c2ec097849c.tar.gz
Move zend_object_iterator_funcs structures into read-only data segment
-rw-r--r--Zend/zend_generators.c2
-rw-r--r--Zend/zend_interfaces.c2
-rw-r--r--Zend/zend_iterators.h4
-rw-r--r--ext/com_dotnet/com_iterator.c2
-rw-r--r--ext/com_dotnet/com_saproxy.c2
-rw-r--r--ext/date/php_date.c2
-rw-r--r--ext/dom/dom_iterators.c2
-rw-r--r--ext/intl/breakiterator/breakiterator_iterators.cpp4
-rw-r--r--ext/intl/common/common_enum.cpp2
-rw-r--r--ext/intl/resourcebundle/resourcebundle_iterator.c2
-rw-r--r--ext/mysqli/mysqli_result_iterator.c4
-rw-r--r--ext/mysqli/php_mysqli_structs.h2
-rw-r--r--ext/pdo/pdo_stmt.c2
-rw-r--r--ext/simplexml/simplexml.c2
-rw-r--r--ext/spl/spl_array.c2
-rw-r--r--ext/spl/spl_directory.c4
-rw-r--r--ext/spl/spl_dllist.c2
-rw-r--r--ext/spl/spl_fixedarray.c2
-rw-r--r--ext/spl/spl_heap.c4
-rw-r--r--ext/spl/spl_iterators.c2
20 files changed, 25 insertions, 25 deletions
diff --git a/Zend/zend_generators.c b/Zend/zend_generators.c
index e47be96850..c75f86ac2f 100644
--- a/Zend/zend_generators.c
+++ b/Zend/zend_generators.c
@@ -1165,7 +1165,7 @@ static void zend_generator_iterator_rewind(zend_object_iterator *iterator) /* {{
}
/* }}} */
-static zend_object_iterator_funcs zend_generator_iterator_functions = {
+static const zend_object_iterator_funcs zend_generator_iterator_functions = {
zend_generator_iterator_dtor,
zend_generator_iterator_valid,
zend_generator_iterator_get_data,
diff --git a/Zend/zend_interfaces.c b/Zend/zend_interfaces.c
index 7a6484c2ba..cde77df4e2 100644
--- a/Zend/zend_interfaces.c
+++ b/Zend/zend_interfaces.c
@@ -224,7 +224,7 @@ ZEND_API void zend_user_it_rewind(zend_object_iterator *_iter)
}
/* }}} */
-zend_object_iterator_funcs zend_interface_iterator_funcs_iterator = {
+static const zend_object_iterator_funcs zend_interface_iterator_funcs_iterator = {
zend_user_it_dtor,
zend_user_it_valid,
zend_user_it_get_current_data,
diff --git a/Zend/zend_iterators.h b/Zend/zend_iterators.h
index a6f7456d02..ec9822ca2e 100644
--- a/Zend/zend_iterators.h
+++ b/Zend/zend_iterators.h
@@ -57,12 +57,12 @@ typedef struct _zend_object_iterator_funcs {
struct _zend_object_iterator {
zend_object std;
zval data;
- zend_object_iterator_funcs *funcs;
+ const zend_object_iterator_funcs *funcs;
zend_ulong index; /* private to fe_reset/fe_fetch opcodes */
};
typedef struct _zend_class_iterator_funcs {
- zend_object_iterator_funcs *funcs;
+ const zend_object_iterator_funcs *funcs;
union _zend_function *zf_new_iterator;
union _zend_function *zf_valid;
union _zend_function *zf_current;
diff --git a/ext/com_dotnet/com_iterator.c b/ext/com_dotnet/com_iterator.c
index 5fb70f6236..5eeaf4dd26 100644
--- a/ext/com_dotnet/com_iterator.c
+++ b/ext/com_dotnet/com_iterator.c
@@ -126,7 +126,7 @@ static int com_iter_move_forwards(zend_object_iterator *iter)
}
-static zend_object_iterator_funcs com_iter_funcs = {
+static const zend_object_iterator_funcs com_iter_funcs = {
com_iter_dtor,
com_iter_valid,
com_iter_get_data,
diff --git a/ext/com_dotnet/com_saproxy.c b/ext/com_dotnet/com_saproxy.c
index c9c20de645..8b4ecc37bb 100644
--- a/ext/com_dotnet/com_saproxy.c
+++ b/ext/com_dotnet/com_saproxy.c
@@ -525,7 +525,7 @@ static int saproxy_iter_move_forwards(zend_object_iterator *iter)
return SUCCESS;
}
-static zend_object_iterator_funcs saproxy_iter_funcs = {
+static const zend_object_iterator_funcs saproxy_iter_funcs = {
saproxy_iter_dtor,
saproxy_iter_valid,
saproxy_iter_get_data,
diff --git a/ext/date/php_date.c b/ext/date/php_date.c
index 10c4db9a5b..124b2d407a 100644
--- a/ext/date/php_date.c
+++ b/ext/date/php_date.c
@@ -1986,7 +1986,7 @@ static void date_period_it_rewind(zend_object_iterator *iter)
/* }}} */
/* iterator handler table */
-zend_object_iterator_funcs date_period_it_funcs = {
+static const zend_object_iterator_funcs date_period_it_funcs = {
date_period_it_dtor,
date_period_it_has_more,
date_period_it_current_data,
diff --git a/ext/dom/dom_iterators.c b/ext/dom/dom_iterators.c
index 27bd960c4a..aa900f7652 100644
--- a/ext/dom/dom_iterators.c
+++ b/ext/dom/dom_iterators.c
@@ -243,7 +243,7 @@ err:
}
/* }}} */
-zend_object_iterator_funcs php_dom_iterator_funcs = {
+static const zend_object_iterator_funcs php_dom_iterator_funcs = {
php_dom_iterator_dtor,
php_dom_iterator_valid,
php_dom_iterator_current_data,
diff --git a/ext/intl/breakiterator/breakiterator_iterators.cpp b/ext/intl/breakiterator/breakiterator_iterators.cpp
index bdf1b3e53f..9fde47ae73 100644
--- a/ext/intl/breakiterator/breakiterator_iterators.cpp
+++ b/ext/intl/breakiterator/breakiterator_iterators.cpp
@@ -80,7 +80,7 @@ static void _breakiterator_rewind(zend_object_iterator *iter)
ZVAL_LONG(&zoi_iter->current, (zend_long)pos);
}
-static zend_object_iterator_funcs breakiterator_iterator_funcs = {
+static const zend_object_iterator_funcs breakiterator_iterator_funcs = {
zoi_with_current_dtor,
zoi_with_current_valid,
zoi_with_current_get_current_data,
@@ -197,7 +197,7 @@ static void _breakiterator_parts_rewind(zend_object_iterator *iter)
iter->funcs->move_forward(iter);
}
-static zend_object_iterator_funcs breakiterator_parts_it_funcs = {
+static const zend_object_iterator_funcs breakiterator_parts_it_funcs = {
zoi_with_current_dtor,
zoi_with_current_valid,
zoi_with_current_get_current_data,
diff --git a/ext/intl/common/common_enum.cpp b/ext/intl/common/common_enum.cpp
index b38ae9aa60..8c964bdd25 100644
--- a/ext/intl/common/common_enum.cpp
+++ b/ext/intl/common/common_enum.cpp
@@ -127,7 +127,7 @@ static void string_enum_destroy_it(zend_object_iterator *iter)
delete (StringEnumeration*)Z_PTR(iter->data);
}
-static zend_object_iterator_funcs string_enum_object_iterator_funcs = {
+static const zend_object_iterator_funcs string_enum_object_iterator_funcs = {
zoi_with_current_dtor,
zoi_with_current_valid,
zoi_with_current_get_current_data,
diff --git a/ext/intl/resourcebundle/resourcebundle_iterator.c b/ext/intl/resourcebundle/resourcebundle_iterator.c
index febf47e87d..07cfc7bc0d 100644
--- a/ext/intl/resourcebundle/resourcebundle_iterator.c
+++ b/ext/intl/resourcebundle/resourcebundle_iterator.c
@@ -135,7 +135,7 @@ static void resourcebundle_iterator_reset( zend_object_iterator *iter )
/* }}} */
/* {{{ resourcebundle_iterator_funcs */
-static zend_object_iterator_funcs resourcebundle_iterator_funcs = {
+static const zend_object_iterator_funcs resourcebundle_iterator_funcs = {
resourcebundle_iterator_dtor,
resourcebundle_iterator_has_more,
resourcebundle_iterator_current,
diff --git a/ext/mysqli/mysqli_result_iterator.c b/ext/mysqli/mysqli_result_iterator.c
index f2c28d5e97..224587c2f2 100644
--- a/ext/mysqli/mysqli_result_iterator.c
+++ b/ext/mysqli/mysqli_result_iterator.c
@@ -33,7 +33,7 @@
#include "zend_interfaces.h"
-extern zend_object_iterator_funcs php_mysqli_result_iterator_funcs;
+extern const zend_object_iterator_funcs php_mysqli_result_iterator_funcs;
typedef struct {
zend_object_iterator intern;
@@ -146,7 +146,7 @@ static void php_mysqli_result_iterator_current_key(zend_object_iterator *iter, z
/* }}} */
/* {{{ php_mysqli_result_iterator_funcs */
-zend_object_iterator_funcs php_mysqli_result_iterator_funcs = {
+const zend_object_iterator_funcs php_mysqli_result_iterator_funcs = {
php_mysqli_result_iterator_dtor,
php_mysqli_result_iterator_valid,
php_mysqli_result_iterator_current_data,
diff --git a/ext/mysqli/php_mysqli_structs.h b/ext/mysqli/php_mysqli_structs.h
index df41cbeb52..3c326beefe 100644
--- a/ext/mysqli/php_mysqli_structs.h
+++ b/ext/mysqli/php_mysqli_structs.h
@@ -211,7 +211,7 @@ extern void php_mysqli_dtor_p_elements(void *data);
extern void php_mysqli_close(MY_MYSQL * mysql, int close_type, int resource_status);
-extern zend_object_iterator_funcs php_mysqli_result_iterator_funcs;
+extern const zend_object_iterator_funcs php_mysqli_result_iterator_funcs;
extern zend_object_iterator *php_mysqli_result_get_iterator(zend_class_entry *ce, zval *object, int by_ref);
extern void php_mysqli_fetch_into_hash_aux(zval *return_value, MYSQL_RES * result, zend_long fetchtype);
diff --git a/ext/pdo/pdo_stmt.c b/ext/pdo/pdo_stmt.c
index 0a825f052e..f05cfce9c6 100644
--- a/ext/pdo/pdo_stmt.c
+++ b/ext/pdo/pdo_stmt.c
@@ -2454,7 +2454,7 @@ static void pdo_stmt_iter_move_forwards(zend_object_iterator *iter)
I->key++;
}
-static zend_object_iterator_funcs pdo_stmt_iter_funcs = {
+static const zend_object_iterator_funcs pdo_stmt_iter_funcs = {
pdo_stmt_iter_dtor,
pdo_stmt_iter_valid,
pdo_stmt_iter_get_data,
diff --git a/ext/simplexml/simplexml.c b/ext/simplexml/simplexml.c
index 6a9cf81641..278342819f 100644
--- a/ext/simplexml/simplexml.c
+++ b/ext/simplexml/simplexml.c
@@ -2335,7 +2335,7 @@ SXE_METHOD(__construct)
}
/* }}} */
-zend_object_iterator_funcs php_sxe_iterator_funcs = { /* {{{ */
+static const zend_object_iterator_funcs php_sxe_iterator_funcs = { /* {{{ */
php_sxe_iterator_dtor,
php_sxe_iterator_valid,
php_sxe_iterator_current_data,
diff --git a/ext/spl/spl_array.c b/ext/spl/spl_array.c
index 4e7faa404a..5da552ce0e 100644
--- a/ext/spl/spl_array.c
+++ b/ext/spl/spl_array.c
@@ -1155,7 +1155,7 @@ static void spl_array_set_array(zval *object, spl_array_object *intern, zval *ar
/* }}} */
/* iterator handler table */
-zend_object_iterator_funcs spl_array_it_funcs = {
+static const zend_object_iterator_funcs spl_array_it_funcs = {
spl_array_it_dtor,
spl_array_it_valid,
spl_array_it_get_current_data,
diff --git a/ext/spl/spl_directory.c b/ext/spl/spl_directory.c
index c320e9c110..a58d5b3cdf 100644
--- a/ext/spl/spl_directory.c
+++ b/ext/spl/spl_directory.c
@@ -1621,7 +1621,7 @@ static void spl_filesystem_dir_it_move_forward(zend_object_iterator *iter);
static void spl_filesystem_dir_it_rewind(zend_object_iterator *iter);
/* iterator handler table */
-zend_object_iterator_funcs spl_filesystem_dir_it_funcs = {
+static const zend_object_iterator_funcs spl_filesystem_dir_it_funcs = {
spl_filesystem_dir_it_dtor,
spl_filesystem_dir_it_valid,
spl_filesystem_dir_it_current_data,
@@ -1820,7 +1820,7 @@ static void spl_filesystem_tree_it_rewind(zend_object_iterator *iter)
/* }}} */
/* {{{ iterator handler table */
-zend_object_iterator_funcs spl_filesystem_tree_it_funcs = {
+static const zend_object_iterator_funcs spl_filesystem_tree_it_funcs = {
spl_filesystem_tree_it_dtor,
spl_filesystem_dir_it_valid,
spl_filesystem_tree_it_current_data,
diff --git a/ext/spl/spl_dllist.c b/ext/spl/spl_dllist.c
index 7b2f677d81..c2ae660bb6 100644
--- a/ext/spl/spl_dllist.c
+++ b/ext/spl/spl_dllist.c
@@ -1282,7 +1282,7 @@ SPL_METHOD(SplDoublyLinkedList, add)
} /* }}} */
/* {{{ iterator handler table */
-zend_object_iterator_funcs spl_dllist_it_funcs = {
+static const zend_object_iterator_funcs spl_dllist_it_funcs = {
spl_dllist_it_dtor,
spl_dllist_it_valid,
spl_dllist_it_get_current_data,
diff --git a/ext/spl/spl_fixedarray.c b/ext/spl/spl_fixedarray.c
index cd2f2ac123..73e4cade91 100644
--- a/ext/spl/spl_fixedarray.c
+++ b/ext/spl/spl_fixedarray.c
@@ -995,7 +995,7 @@ SPL_METHOD(SplFixedArray, current)
/* }}} */
/* iterator handler table */
-zend_object_iterator_funcs spl_fixedarray_it_funcs = {
+static const zend_object_iterator_funcs spl_fixedarray_it_funcs = {
spl_fixedarray_it_dtor,
spl_fixedarray_it_valid,
spl_fixedarray_it_get_current_data,
diff --git a/ext/spl/spl_heap.c b/ext/spl/spl_heap.c
index 38ce4c6241..6c27ef5ef3 100644
--- a/ext/spl/spl_heap.c
+++ b/ext/spl/spl_heap.c
@@ -1060,7 +1060,7 @@ SPL_METHOD(SplPriorityQueue, current)
/* }}} */
/* iterator handler table */
-zend_object_iterator_funcs spl_heap_it_funcs = {
+static const zend_object_iterator_funcs spl_heap_it_funcs = {
spl_heap_it_dtor,
spl_heap_it_valid,
spl_heap_it_get_current_data,
@@ -1070,7 +1070,7 @@ zend_object_iterator_funcs spl_heap_it_funcs = {
NULL
};
-zend_object_iterator_funcs spl_pqueue_it_funcs = {
+static const zend_object_iterator_funcs spl_pqueue_it_funcs = {
spl_heap_it_dtor,
spl_heap_it_valid,
spl_pqueue_it_get_current_data,
diff --git a/ext/spl/spl_iterators.c b/ext/spl/spl_iterators.c
index 7d33aac322..be36565c45 100644
--- a/ext/spl/spl_iterators.c
+++ b/ext/spl/spl_iterators.c
@@ -465,7 +465,7 @@ static zend_object_iterator *spl_recursive_it_get_iterator(zend_class_entry *ce,
return (zend_object_iterator*)iterator;
}
-zend_object_iterator_funcs spl_recursive_it_iterator_funcs = {
+static const zend_object_iterator_funcs spl_recursive_it_iterator_funcs = {
spl_recursive_it_dtor,
spl_recursive_it_valid,
spl_recursive_it_get_current_data,