summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--Zend/zend_gc.c18
-rw-r--r--Zend/zend_object_handlers.c4
-rw-r--r--Zend/zend_objects.c4
-rw-r--r--Zend/zend_objects_API.c22
-rw-r--r--Zend/zend_objects_API.h2
-rw-r--r--Zend/zend_types.h2
-rw-r--r--ext/pdo_mysql/mysql_statement.c2
-rw-r--r--ext/pdo_pgsql/pgsql_statement.c2
8 files changed, 29 insertions, 27 deletions
diff --git a/Zend/zend_gc.c b/Zend/zend_gc.c
index adebbbb791..39ed6a96a9 100644
--- a/Zend/zend_gc.c
+++ b/Zend/zend_gc.c
@@ -379,7 +379,7 @@ tail_call:
zend_object_get_gc_t get_gc;
zend_object *obj = (zend_object*)ref;
- if (EXPECTED(!(GC_FLAGS(ref) & IS_OBJ_FREE_CALLED) &&
+ if (EXPECTED(!(OBJ_FLAGS(ref) & IS_OBJ_FREE_CALLED) &&
(get_gc = obj->handlers->get_gc) != NULL)) {
int n;
zval *zv, *end;
@@ -489,7 +489,7 @@ tail_call:
zend_object_get_gc_t get_gc;
zend_object *obj = (zend_object*)ref;
- if (EXPECTED(!(GC_FLAGS(ref) & IS_OBJ_FREE_CALLED) &&
+ if (EXPECTED(!(OBJ_FLAGS(ref) & IS_OBJ_FREE_CALLED) &&
(get_gc = obj->handlers->get_gc) != NULL)) {
int n;
zval *zv, *end;
@@ -602,7 +602,7 @@ tail_call:
zend_object_get_gc_t get_gc;
zend_object *obj = (zend_object*)ref;
- if (EXPECTED(!(GC_FLAGS(ref) & IS_OBJ_FREE_CALLED) &&
+ if (EXPECTED(!(OBJ_FLAGS(ref) & IS_OBJ_FREE_CALLED) &&
(get_gc = obj->handlers->get_gc) != NULL)) {
int n;
zval *zv, *end;
@@ -764,7 +764,7 @@ tail_call:
zend_object_get_gc_t get_gc;
zend_object *obj = (zend_object*)ref;
- if (EXPECTED(!(GC_FLAGS(ref) & IS_OBJ_FREE_CALLED) &&
+ if (EXPECTED(!(OBJ_FLAGS(ref) & IS_OBJ_FREE_CALLED) &&
(get_gc = obj->handlers->get_gc) != NULL)) {
int n;
zval *zv, *end;
@@ -956,7 +956,7 @@ tail_call:
zend_object_get_gc_t get_gc;
zend_object *obj = (zend_object*)ref;
- if (EXPECTED(!(GC_FLAGS(ref) & IS_OBJ_FREE_CALLED) &&
+ if (EXPECTED(!(OBJ_FLAGS(ref) & IS_OBJ_FREE_CALLED) &&
(get_gc = obj->handlers->get_gc) != NULL)) {
int n;
zval *zv, *end;
@@ -1112,9 +1112,9 @@ ZEND_API int zend_gc_collect_cycles(void)
if (GC_TYPE(p) == IS_OBJECT) {
zend_object *obj = (zend_object*)p;
- if (!(GC_FLAGS(obj) & IS_OBJ_DESTRUCTOR_CALLED)) {
+ if (!(OBJ_FLAGS(obj) & IS_OBJ_DESTRUCTOR_CALLED)) {
GC_TRACE_REF(obj, "calling destructor");
- GC_FLAGS(obj) |= IS_OBJ_DESTRUCTOR_CALLED;
+ OBJ_FLAGS(obj) |= IS_OBJ_DESTRUCTOR_CALLED;
if (obj->handlers->dtor_obj
&& (obj->handlers->dtor_obj != zend_objects_destroy_object
|| obj->ce->destructor)) {
@@ -1151,8 +1151,8 @@ ZEND_API int zend_gc_collect_cycles(void)
EG(objects_store).object_buckets[obj->handle] = SET_OBJ_INVALID(obj);
GC_TYPE(obj) = IS_NULL;
- if (!(GC_FLAGS(obj) & IS_OBJ_FREE_CALLED)) {
- GC_FLAGS(obj) |= IS_OBJ_FREE_CALLED;
+ if (!(OBJ_FLAGS(obj) & IS_OBJ_FREE_CALLED)) {
+ OBJ_FLAGS(obj) |= IS_OBJ_FREE_CALLED;
if (obj->handlers->free_obj) {
GC_ADDREF(obj);
obj->handlers->free_obj(obj);
diff --git a/Zend/zend_object_handlers.c b/Zend/zend_object_handlers.c
index 5eef84d885..2a029ebfdd 100644
--- a/Zend/zend_object_handlers.c
+++ b/Zend/zend_object_handlers.c
@@ -495,7 +495,7 @@ ZEND_API uint32_t *zend_get_property_guard(zend_object *zobj, zend_string *membe
zval *zv;
uint32_t *ptr;
- ZEND_ASSERT(GC_FLAGS(zobj) & IS_OBJ_USE_GUARDS);
+ ZEND_ASSERT(OBJ_FLAGS(zobj) & IS_OBJ_USE_GUARDS);
zv = zobj->properties_table + zobj->ce->default_properties_count;
if (EXPECTED(Z_TYPE_P(zv) == IS_STRING)) {
zend_string *str = Z_STR_P(zv);
@@ -526,7 +526,7 @@ ZEND_API uint32_t *zend_get_property_guard(zend_object *zobj, zend_string *membe
}
} else {
ZEND_ASSERT(Z_TYPE_P(zv) == IS_UNDEF);
- GC_FLAGS(zobj) |= IS_OBJ_HAS_GUARDS;
+ OBJ_FLAGS(zobj) |= IS_OBJ_HAS_GUARDS;
ZVAL_STR_COPY(zv, member);
zv->u2.property_guard = 0;
return &zv->u2.property_guard;
diff --git a/Zend/zend_objects.c b/Zend/zend_objects.c
index 53e11b1e77..1e362e678d 100644
--- a/Zend/zend_objects.c
+++ b/Zend/zend_objects.c
@@ -35,7 +35,7 @@ ZEND_API void ZEND_FASTCALL zend_object_std_init(zend_object *object, zend_class
object->properties = NULL;
zend_objects_store_put(object);
if (UNEXPECTED(ce->ce_flags & ZEND_ACC_USE_GUARDS)) {
- GC_FLAGS(object) |= IS_OBJ_USE_GUARDS;
+ OBJ_FLAGS(object) |= IS_OBJ_USE_GUARDS;
ZVAL_UNDEF(object->properties_table + object->ce->default_properties_count);
}
}
@@ -59,7 +59,7 @@ ZEND_API void zend_object_std_dtor(zend_object *object)
p++;
} while (p != end);
}
- if (UNEXPECTED(GC_FLAGS(object) & IS_OBJ_HAS_GUARDS)) {
+ if (UNEXPECTED(OBJ_FLAGS(object) & IS_OBJ_HAS_GUARDS)) {
if (EXPECTED(Z_TYPE_P(p) == IS_STRING)) {
zend_string_release(Z_STR_P(p));
} else {
diff --git a/Zend/zend_objects_API.c b/Zend/zend_objects_API.c
index a8d9d0ea25..633b48a2cb 100644
--- a/Zend/zend_objects_API.c
+++ b/Zend/zend_objects_API.c
@@ -48,8 +48,8 @@ ZEND_API void ZEND_FASTCALL zend_objects_store_call_destructors(zend_objects_sto
for (i = 1; i < objects->top; i++) {
zend_object *obj = objects->object_buckets[i];
if (IS_OBJ_VALID(obj)) {
- if (!(GC_FLAGS(obj) & IS_OBJ_DESTRUCTOR_CALLED)) {
- GC_FLAGS(obj) |= IS_OBJ_DESTRUCTOR_CALLED;
+ if (!(OBJ_FLAGS(obj) & IS_OBJ_DESTRUCTOR_CALLED)) {
+ OBJ_FLAGS(obj) |= IS_OBJ_DESTRUCTOR_CALLED;
if (obj->handlers->dtor_obj
&& (obj->handlers->dtor_obj != zend_objects_destroy_object
@@ -74,7 +74,7 @@ ZEND_API void ZEND_FASTCALL zend_objects_store_mark_destructed(zend_objects_stor
zend_object *obj = *obj_ptr;
if (IS_OBJ_VALID(obj)) {
- GC_FLAGS(obj) |= IS_OBJ_DESTRUCTOR_CALLED;
+ OBJ_FLAGS(obj) |= IS_OBJ_DESTRUCTOR_CALLED;
}
obj_ptr++;
} while (obj_ptr != end);
@@ -98,8 +98,8 @@ ZEND_API void ZEND_FASTCALL zend_objects_store_free_object_storage(zend_objects_
obj_ptr--;
obj = *obj_ptr;
if (IS_OBJ_VALID(obj)) {
- if (!(GC_FLAGS(obj) & IS_OBJ_FREE_CALLED)) {
- GC_FLAGS(obj) |= IS_OBJ_FREE_CALLED;
+ if (!(OBJ_FLAGS(obj) & IS_OBJ_FREE_CALLED)) {
+ OBJ_FLAGS(obj) |= IS_OBJ_FREE_CALLED;
if (obj->handlers->free_obj && obj->handlers->free_obj != zend_object_std_dtor) {
GC_ADDREF(obj);
obj->handlers->free_obj(obj);
@@ -113,8 +113,8 @@ ZEND_API void ZEND_FASTCALL zend_objects_store_free_object_storage(zend_objects_
obj_ptr--;
obj = *obj_ptr;
if (IS_OBJ_VALID(obj)) {
- if (!(GC_FLAGS(obj) & IS_OBJ_FREE_CALLED)) {
- GC_FLAGS(obj) |= IS_OBJ_FREE_CALLED;
+ if (!(OBJ_FLAGS(obj) & IS_OBJ_FREE_CALLED)) {
+ OBJ_FLAGS(obj) |= IS_OBJ_FREE_CALLED;
if (obj->handlers->free_obj) {
GC_ADDREF(obj);
obj->handlers->free_obj(obj);
@@ -164,8 +164,8 @@ ZEND_API void ZEND_FASTCALL zend_objects_store_del(zend_object *object) /* {{{ *
ZEND_ASSERT(IS_OBJ_VALID(EG(objects_store).object_buckets[object->handle]));
ZEND_ASSERT(GC_REFCOUNT(object) == 0);
- if (!(GC_FLAGS(object) & IS_OBJ_DESTRUCTOR_CALLED)) {
- GC_FLAGS(object) |= IS_OBJ_DESTRUCTOR_CALLED;
+ if (!(OBJ_FLAGS(object) & IS_OBJ_DESTRUCTOR_CALLED)) {
+ OBJ_FLAGS(object) |= IS_OBJ_DESTRUCTOR_CALLED;
if (object->handlers->dtor_obj
&& (object->handlers->dtor_obj != zend_objects_destroy_object
@@ -181,8 +181,8 @@ ZEND_API void ZEND_FASTCALL zend_objects_store_del(zend_object *object) /* {{{ *
void *ptr;
EG(objects_store).object_buckets[handle] = SET_OBJ_INVALID(object);
- if (!(GC_FLAGS(object) & IS_OBJ_FREE_CALLED)) {
- GC_FLAGS(object) |= IS_OBJ_FREE_CALLED;
+ if (!(OBJ_FLAGS(object) & IS_OBJ_FREE_CALLED)) {
+ OBJ_FLAGS(object) |= IS_OBJ_FREE_CALLED;
if (object->handlers->free_obj) {
GC_ADDREF(object);
object->handlers->free_obj(object);
diff --git a/Zend/zend_objects_API.h b/Zend/zend_objects_API.h
index 7fd073f7ad..a581c4b209 100644
--- a/Zend/zend_objects_API.h
+++ b/Zend/zend_objects_API.h
@@ -62,7 +62,7 @@ ZEND_API void ZEND_FASTCALL zend_objects_store_del(zend_object *object);
/* Called when the ctor was terminated by an exception */
static zend_always_inline void zend_object_store_ctor_failed(zend_object *obj)
{
- GC_FLAGS(obj) |= IS_OBJ_DESTRUCTOR_CALLED;
+ OBJ_FLAGS(obj) |= IS_OBJ_DESTRUCTOR_CALLED;
}
#define ZEND_OBJECTS_STORE_HANDLERS 0, zend_object_std_dtor, zend_objects_destroy_object, zend_objects_clone_obj
diff --git a/Zend/zend_types.h b/Zend/zend_types.h
index 7fa90fdbd1..ac81406171 100644
--- a/Zend/zend_types.h
+++ b/Zend/zend_types.h
@@ -498,6 +498,8 @@ static zend_always_inline zend_uchar zval_get_type(const zval* pz) {
#define IS_OBJ_USE_GUARDS (1<<6)
#define IS_OBJ_HAS_GUARDS (1<<7)
+#define OBJ_FLAGS(obj) GC_FLAGS(obj)
+
/* Recursion protection macros must be used only for arrays and objects */
#define GC_IS_RECURSIVE(p) \
(GC_FLAGS(p) & GC_PROTECTED)
diff --git a/ext/pdo_mysql/mysql_statement.c b/ext/pdo_mysql/mysql_statement.c
index ce918f1e69..854623f314 100644
--- a/ext/pdo_mysql/mysql_statement.c
+++ b/ext/pdo_mysql/mysql_statement.c
@@ -90,7 +90,7 @@ static int pdo_mysql_stmt_dtor(pdo_stmt_t *stmt) /* {{{ */
if (!Z_ISUNDEF(stmt->database_object_handle)
&& IS_OBJ_VALID(EG(objects_store).object_buckets[Z_OBJ_HANDLE(stmt->database_object_handle)])
- && (!(GC_FLAGS(Z_OBJ(stmt->database_object_handle)) & IS_OBJ_FREE_CALLED))) {
+ && (!(OBJ_FLAGS(Z_OBJ(stmt->database_object_handle)) & IS_OBJ_FREE_CALLED))) {
while (mysql_more_results(S->H->server)) {
MYSQL_RES *res;
if (mysql_next_result(S->H->server) != 0) {
diff --git a/ext/pdo_pgsql/pgsql_statement.c b/ext/pdo_pgsql/pgsql_statement.c
index 02483e6c23..2321d20576 100644
--- a/ext/pdo_pgsql/pgsql_statement.c
+++ b/ext/pdo_pgsql/pgsql_statement.c
@@ -63,7 +63,7 @@ static int pgsql_stmt_dtor(pdo_stmt_t *stmt)
pdo_pgsql_stmt *S = (pdo_pgsql_stmt*)stmt->driver_data;
zend_bool server_obj_usable = !Z_ISUNDEF(stmt->database_object_handle)
&& IS_OBJ_VALID(EG(objects_store).object_buckets[Z_OBJ_HANDLE(stmt->database_object_handle)])
- && !(GC_FLAGS(Z_OBJ(stmt->database_object_handle)) & IS_OBJ_FREE_CALLED);
+ && !(OBJ_FLAGS(Z_OBJ(stmt->database_object_handle)) & IS_OBJ_FREE_CALLED);
if (S->result) {
/* free the resource */