Skip to content

Commit fcccb0d

Browse files
committed
Use zval_ptr_dtor_nogc() in places where circular zvals are not possible
1 parent 3ed3bc3 commit fcccb0d

File tree

5 files changed

+79
-79
lines changed

5 files changed

+79
-79
lines changed

Zend/zend_execute.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -739,7 +739,7 @@ static int is_null_constant(zend_class_entry *scope, zval *default_value)
739739
if (Z_TYPE(constant) == IS_NULL) {
740740
return 1;
741741
}
742-
zval_ptr_dtor(&constant);
742+
zval_ptr_dtor_nogc(&constant);
743743
}
744744
return 0;
745745
}

Zend/zend_execute_API.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -333,7 +333,7 @@ void shutdown_executor(void) /* {{{ */
333333
if (c->flags & CONST_PERSISTENT) {
334334
break;
335335
}
336-
zval_ptr_dtor(&c->value);
336+
zval_ptr_dtor_nogc(&c->value);
337337
if (c->name) {
338338
zend_string_release(c->name);
339339
}
@@ -623,7 +623,7 @@ ZEND_API int zval_update_constant_ex(zval *p, zend_class_entry *scope) /* {{{ */
623623
return FAILURE;
624624
}
625625
if (inline_change) {
626-
zval_ptr_dtor(p);
626+
zval_ptr_dtor_nogc(p);
627627
}
628628
ZVAL_COPY_VALUE(p, &tmp);
629629
}

Zend/zend_opcode.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -291,7 +291,7 @@ ZEND_API void destroy_zend_class(zval *zv)
291291

292292
ZEND_HASH_FOREACH_PTR(&ce->constants_table, c) {
293293
if (c->ce == ce) {
294-
zval_ptr_dtor(&c->value);
294+
zval_ptr_dtor_nogc(&c->value);
295295
if (c->doc_comment) {
296296
zend_string_release(c->doc_comment);
297297
}

Zend/zend_vm_def.h

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2046,7 +2046,7 @@ ZEND_VM_HANDLER(136, ZEND_ASSIGN_OBJ, VAR|UNUSED|THIS|CV, CONST|TMPVAR|CV, SPEC(
20462046
(Z_TYPE_P(object) == IS_STRING && Z_STRLEN_P(object) == 0))) {
20472047
zend_object *obj;
20482048

2049-
zval_ptr_dtor(object);
2049+
zval_ptr_dtor_nogc(object);
20502050
object_init(object);
20512051
Z_ADDREF_P(object);
20522052
obj = Z_OBJ_P(object);
@@ -4679,7 +4679,7 @@ ZEND_VM_HOT_HANDLER(64, ZEND_RECV_INIT, NUM, CONST)
46794679
if (Z_OPT_CONSTANT_P(param)) {
46804680
SAVE_OPLINE();
46814681
if (UNEXPECTED(zval_update_constant_ex(param, EX(func)->op_array.scope) != SUCCESS)) {
4682-
zval_ptr_dtor(param);
4682+
zval_ptr_dtor_nogc(param);
46834683
ZVAL_UNDEF(param);
46844684
HANDLE_EXCEPTION();
46854685
}
@@ -5193,13 +5193,13 @@ ZEND_VM_C_LABEL(num_index):
51935193
ZEND_VM_C_GOTO(str_index);
51945194
} else {
51955195
zend_error(E_WARNING, "Illegal offset type");
5196-
zval_ptr_dtor(expr_ptr);
5196+
zval_ptr_dtor_nogc(expr_ptr);
51975197
}
51985198
FREE_OP2();
51995199
} else {
52005200
if (!zend_hash_next_index_insert(Z_ARRVAL_P(EX_VAR(opline->result.var)), expr_ptr)) {
52015201
zend_error(E_WARNING, "Cannot add element to the array as the next element is already occupied");
5202-
zval_ptr_dtor(expr_ptr);
5202+
zval_ptr_dtor_nogc(expr_ptr);
52035203
}
52045204
}
52055205
ZEND_VM_NEXT_OPCODE_CHECK_EXCEPTION();
@@ -7150,7 +7150,7 @@ ZEND_VM_HANDLER(143, ZEND_DECLARE_CONST, CONST, CONST)
71507150
ZVAL_COPY(&c.value, val);
71517151
if (Z_OPT_CONSTANT(c.value)) {
71527152
if (UNEXPECTED(zval_update_constant_ex(&c.value, EX(func)->op_array.scope) != SUCCESS)) {
7153-
zval_ptr_dtor(&c.value);
7153+
zval_ptr_dtor_nogc(&c.value);
71547154
FREE_OP1();
71557155
FREE_OP2();
71567156
HANDLE_EXCEPTION();

0 commit comments

Comments
 (0)