Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

unset() now returns a boolean

The __unset() magic method may return a value which is, casted to boolean, returned by unset()
The class functions unset_dimension and unset_property are now changed to return an int: the return value should be SUCCESS or FAILURE
  • Loading branch information...
commit 787d71eed0c5e0140048b8fbacf799029b322661 1 parent 7e5f761
@bwoebi authored
View
2  Zend/zend_API.h
@@ -509,7 +509,7 @@ ZEND_API int zend_call_function(zend_fcall_info *fci, zend_fcall_info_cache *fci
ZEND_API int zend_set_hash_symbol(zval *symbol, const char *name, int name_length, zend_bool is_ref, int num_symbol_tables, ...);
-ZEND_API void zend_delete_variable(zend_execute_data *ex, HashTable *ht, const char *name, int name_len, ulong hash_value TSRMLS_DC);
+ZEND_API int zend_delete_variable(zend_execute_data *ex, HashTable *ht, const char *name, int name_len, ulong hash_value TSRMLS_DC);
ZEND_API int zend_delete_global_variable(const char *name, int name_len TSRMLS_DC);
View
3  Zend/zend_closures.c
@@ -228,9 +228,10 @@ static int zend_closure_has_property(zval *object, zval *member, int has_set_exi
}
/* }}} */
-static void zend_closure_unset_property(zval *object, zval *member, const zend_literal *key TSRMLS_DC) /* {{{ */
+static int zend_closure_unset_property(zval *object, zval *member, const zend_literal *key TSRMLS_DC) /* {{{ */
{
ZEND_CLOSURE_PROPERTY_ERROR();
+ return FAILURE;
}
/* }}} */
View
14 Zend/zend_compile.c
@@ -6100,37 +6100,39 @@ void zend_do_indirect_references(znode *result, const znode *num_references, zno
}
/* }}} */
-void zend_do_unset(const znode *variable TSRMLS_DC) /* {{{ */
+void zend_do_unset(znode *result, const znode *variable TSRMLS_DC) /* {{{ */
{
zend_op *last_op;
- zend_check_writable_variable(variable);
+// zend_check_writable_variable(variable);
+ zend_do_end_variable_parse(variable, BP_VAR_UNSET, 0 TSRMLS_CC);
if (variable->op_type == IS_CV) {
zend_op *opline = get_next_op(CG(active_op_array) TSRMLS_CC);
opline->opcode = ZEND_UNSET_VAR;
SET_NODE(opline->op1, variable);
SET_UNUSED(opline->op2);
- SET_UNUSED(opline->result);
+ opline->result.var = get_temporary_variable(CG(active_op_array));
+ opline->result_type = IS_TMP_VAR;
opline->extended_value = ZEND_FETCH_LOCAL | ZEND_QUICK_SET;
+ GET_NODE(result, opline->result);
} else {
last_op = &CG(active_op_array)->opcodes[get_next_op_number(CG(active_op_array))-1];
+ last_op->result_type = IS_TMP_VAR;
switch (last_op->opcode) {
case ZEND_FETCH_UNSET:
last_op->opcode = ZEND_UNSET_VAR;
- SET_UNUSED(last_op->result);
break;
case ZEND_FETCH_DIM_UNSET:
last_op->opcode = ZEND_UNSET_DIM;
- SET_UNUSED(last_op->result);
break;
case ZEND_FETCH_OBJ_UNSET:
last_op->opcode = ZEND_UNSET_OBJ;
- SET_UNUSED(last_op->result);
break;
}
+ GET_NODE(result, last_op->result);
}
}
/* }}} */
View
6 Zend/zend_compile.h
@@ -74,7 +74,7 @@ typedef struct _zend_literal {
#define Z_HASH_P(zv) \
(((zend_literal*)(zv))->hash_value)
-typedef union _znode_op {
+typedef union _znode_op {
zend_uint constant;
zend_uint var;
zend_uint num;
@@ -86,7 +86,7 @@ typedef union _znode_op {
void *ptr; /* Used for passing pointers from the compile to execution phase, currently used for traits */
} znode_op;
-typedef struct _znode { /* used only during compilation */
+typedef struct _znode { /* used only during compilation */
int op_type;
union {
znode_op op;
@@ -597,7 +597,7 @@ void zend_add_to_list(void *result, void *item TSRMLS_DC);
void zend_do_cast(znode *result, const znode *expr, int type TSRMLS_DC);
void zend_do_include_or_eval(int type, znode *result, const znode *op1 TSRMLS_DC);
-void zend_do_unset(const znode *variable TSRMLS_DC);
+void zend_do_unset(znode *result, const znode *variable TSRMLS_DC);
void zend_do_isset_or_isempty(int type, znode *result, znode *variable TSRMLS_DC);
void zend_do_instanceof(znode *result, const znode *expr, const znode *class_znode, int type TSRMLS_DC);
View
4 Zend/zend_execute_API.c
@@ -1676,7 +1676,7 @@ ZEND_API void zend_reset_all_cv(HashTable *symbol_table TSRMLS_DC) /* {{{ */
}
/* }}} */
-ZEND_API void zend_delete_variable(zend_execute_data *ex, HashTable *ht, const char *name, int name_len, ulong hash_value TSRMLS_DC) /* {{{ */
+ZEND_API int zend_delete_variable(zend_execute_data *ex, HashTable *ht, const char *name, int name_len, ulong hash_value TSRMLS_DC) /* {{{ */
{
if (zend_hash_quick_del(ht, name, name_len, hash_value) == SUCCESS) {
name_len--;
@@ -1695,7 +1695,9 @@ ZEND_API void zend_delete_variable(zend_execute_data *ex, HashTable *ht, const c
}
ex = ex->prev_execute_data;
}
+ return SUCCESS;
}
+ return FAILURE;
}
/* }}} */
View
9 Zend/zend_language_parser.y
@@ -306,7 +306,6 @@ unticked_statement:
| T_ECHO echo_expr_list ';'
| T_INLINE_HTML { zend_do_echo(&$1 TSRMLS_CC); }
| expr ';' { zend_do_free(&$1 TSRMLS_CC); }
- | T_UNSET '(' unset_variables ')' ';'
| T_FOREACH '(' variable T_AS
{ zend_do_foreach_begin(&$1, &$2, &$3, &$4, 1 TSRMLS_CC); }
foreach_variable foreach_optional_arg ')' { zend_do_foreach_cont(&$1, &$2, &$4, &$6, &$7 TSRMLS_CC); }
@@ -352,12 +351,13 @@ additional_catch:
;
unset_variables:
- unset_variable
- | unset_variables ',' unset_variable
+ unset_variable { $$ = $1; }
+ | unset_variables ',' { zend_do_boolean_and_begin(&$1, &$2 TSRMLS_CC); } unset_variable { zend_do_boolean_and_end(&$$, &$1, &$4, &$2 TSRMLS_CC); }
;
unset_variable:
- variable { zend_do_end_variable_parse(&$1, BP_VAR_UNSET, 0 TSRMLS_CC); zend_do_unset(&$1 TSRMLS_CC); }
+ variable { zend_do_unset(&$$, &$1 TSRMLS_CC); }
+ | expr_without_variable { zend_error(E_COMPILE_ERROR, "Cannot use unset() on the result of an expression, only on variables"); }
;
function_declaration_statement:
@@ -1180,6 +1180,7 @@ internal_functions_in_yacc:
T_ISSET '(' isset_variables ')' { $$ = $3; }
| T_EMPTY '(' variable ')' { zend_do_isset_or_isempty(ZEND_ISEMPTY, &$$, &$3 TSRMLS_CC); }
| T_EMPTY '(' expr_without_variable ')' { zend_do_unary_op(ZEND_BOOL_NOT, &$$, &$3 TSRMLS_CC); }
+ | T_UNSET '(' unset_variables ')' { $$ = $3; }
| T_INCLUDE expr { zend_do_include_or_eval(ZEND_INCLUDE, &$$, &$2 TSRMLS_CC); }
| T_INCLUDE_ONCE expr { zend_do_include_or_eval(ZEND_INCLUDE_ONCE, &$$, &$2 TSRMLS_CC); }
| T_EVAL '(' expr ')' { zend_do_include_or_eval(ZEND_EVAL, &$$, &$3 TSRMLS_CC); }
View
30 Zend/zend_object_handlers.c
@@ -197,7 +197,7 @@ static int zend_std_call_setter(zval *object, zval *member, zval *value TSRMLS_D
}
/* }}} */
-static void zend_std_call_unsetter(zval *object, zval *member TSRMLS_DC) /* {{{ */
+static int zend_std_call_unsetter(zval *object, zval *member TSRMLS_DC) /* {{{ */
{
zend_class_entry *ce = Z_OBJCE_P(object);
@@ -207,9 +207,12 @@ static void zend_std_call_unsetter(zval *object, zval *member TSRMLS_DC) /* {{{
SEPARATE_ARG_IF_REF(member);
- zend_call_method_with_1_params(&object, ce, &ce->__unset, ZEND_UNSET_FUNC_NAME, NULL, member);
+ zval *ret_zval = zend_call_method_with_1_params(&object, ce, &ce->__unset, ZEND_UNSET_FUNC_NAME, NULL, member);
zval_ptr_dtor(&member);
+
+ convert_to_boolean(ret_zval);
+ return Z_LVAL_P(ret_zval)?SUCCESS:FAILURE;
}
/* }}} */
@@ -786,11 +789,12 @@ static zval **zend_std_get_property_ptr_ptr(zval *object, zval *member, const ze
}
/* }}} */
-static void zend_std_unset_property(zval *object, zval *member, const zend_literal *key TSRMLS_DC) /* {{{ */
+static int zend_std_unset_property(zval *object, zval *member, const zend_literal *key TSRMLS_DC) /* {{{ */
{
zend_object *zobj;
zval *tmp_member = NULL;
zend_property_info *property_info;
+ int result = FAILURE;
zobj = Z_OBJ_P(object);
@@ -813,9 +817,10 @@ static void zend_std_unset_property(zval *object, zval *member, const zend_liter
EXPECTED(zobj->properties_table[property_info->offset] != NULL)) {
zval_ptr_dtor(&zobj->properties_table[property_info->offset]);
zobj->properties_table[property_info->offset] = NULL;
+ result = SUCCESS;
} else if (UNEXPECTED(!property_info) ||
!zobj->properties ||
- UNEXPECTED(zend_hash_quick_del(zobj->properties, property_info->name, property_info->name_length+1, property_info->h) == FAILURE)) {
+ UNEXPECTED((result = zend_hash_quick_del(zobj->properties, property_info->name, property_info->name_length+1, property_info->h)) == FAILURE)) {
zend_guard *guard = NULL;
if (zobj->ce->__unset &&
@@ -827,7 +832,7 @@ static void zend_std_unset_property(zval *object, zval *member, const zend_liter
SEPARATE_ZVAL(&object);
}
guard->in_unset = 1; /* prevent circular unsetting */
- zend_std_call_unsetter(object, member TSRMLS_CC);
+ result = zend_std_call_unsetter(object, member TSRMLS_CC);
guard->in_unset = 0;
zval_ptr_dtor(&object);
} else if (zobj->ce->__unset && guard && guard->in_unset == 1) {
@@ -838,30 +843,37 @@ static void zend_std_unset_property(zval *object, zval *member, const zend_liter
zend_error(E_ERROR, "Cannot access property started with '\\0'");
}
}
+ result = FAILURE;
}
} else if (EXPECTED(property_info != NULL) &&
EXPECTED((property_info->flags & ZEND_ACC_STATIC) == 0) &&
property_info->offset >= 0) {
zobj->properties_table[property_info->offset] = NULL;
+ result = SUCCESS;
}
if (UNEXPECTED(tmp_member != NULL)) {
zval_ptr_dtor(&tmp_member);
}
+
+ return result;
}
/* }}} */
-static void zend_std_unset_dimension(zval *object, zval *offset TSRMLS_DC) /* {{{ */
+static int zend_std_unset_dimension(zval *object, zval *offset TSRMLS_DC) /* {{{ */
{
zend_class_entry *ce = Z_OBJCE_P(object);
if (instanceof_function_ex(ce, zend_ce_arrayaccess, 1 TSRMLS_CC)) {
SEPARATE_ARG_IF_REF(offset);
- zend_call_method_with_1_params(&object, ce, NULL, "offsetunset", NULL, offset);
+ zval *ret_zval = zend_call_method_with_1_params(&object, ce, NULL, "offsetunset", NULL, offset);
zval_ptr_dtor(&offset);
- } else {
- zend_error_noreturn(E_ERROR, "Cannot use object of type %s as array", ce->name);
+ convert_to_boolean(ret_zval);
+ return Z_LVAL_P(ret_zval)?SUCCESS:FAILURE;
}
+
+ zend_error_noreturn(E_ERROR, "Cannot use object of type %s as array", ce->name);
+ return FAILURE;
}
/* }}} */
View
4 Zend/zend_object_handlers.h
@@ -73,10 +73,10 @@ typedef int (*zend_object_has_property_t)(zval *object, zval *member, int has_se
typedef int (*zend_object_has_dimension_t)(zval *object, zval *member, int check_empty TSRMLS_DC);
/* Used to remove a property of the object */
-typedef void (*zend_object_unset_property_t)(zval *object, zval *member, const struct _zend_literal *key TSRMLS_DC);
+typedef int (*zend_object_unset_property_t)(zval *object, zval *member, const struct _zend_literal *key TSRMLS_DC);
/* Used to remove a dimension of the object */
-typedef void (*zend_object_unset_dimension_t)(zval *object, zval *offset TSRMLS_DC);
+typedef int (*zend_object_unset_dimension_t)(zval *object, zval *offset TSRMLS_DC);
/* Used to get hash of the properties of the object, as hash of zval's */
typedef HashTable *(*zend_object_get_properties_t)(zval *object TSRMLS_DC);
View
39 Zend/zend_vm_def.h
@@ -3885,6 +3885,7 @@ ZEND_VM_HANDLER(74, ZEND_UNSET_VAR, CONST|TMP|VAR|CV, UNUSED|CONST|VAR)
zval tmp, *varname;
HashTable *target_symbol_table;
zend_free_op free_op1;
+ int result = FAILURE;
SAVE_OPLINE();
if (OP1_TYPE == IS_CV &&
@@ -3893,12 +3894,14 @@ ZEND_VM_HANDLER(74, ZEND_UNSET_VAR, CONST|TMP|VAR|CV, UNUSED|CONST|VAR)
if (EG(active_symbol_table)) {
zend_compiled_variable *cv = &CV_DEF_OF(opline->op1.var);
- zend_delete_variable(EX(prev_execute_data), EG(active_symbol_table), cv->name, cv->name_len+1, cv->hash_value TSRMLS_CC);
+ result = zend_delete_variable(EX(prev_execute_data), EG(active_symbol_table), cv->name, cv->name_len+1, cv->hash_value TSRMLS_CC);
EX_CV(opline->op1.var) = NULL;
} else if (EX_CV(opline->op1.var)) {
zval_ptr_dtor(EX_CV(opline->op1.var));
+ result = SUCCESS;
EX_CV(opline->op1.var) = NULL;
}
+ ZVAL_BOOL(&EX_T(opline->result.var).tmp_var, result==SUCCESS?1:0);
CHECK_EXCEPTION();
ZEND_VM_NEXT_OPCODE();
}
@@ -3928,6 +3931,7 @@ ZEND_VM_HANDLER(74, ZEND_UNSET_VAR, CONST|TMP|VAR|CV, UNUSED|CONST|VAR)
} else if (OP1_TYPE == IS_VAR || OP1_TYPE == IS_CV) {
zval_ptr_dtor(&varname);
}
+ ZVAL_BOOL(&EX_T(opline->result.var).tmp_var, 0);
FREE_OP1();
CHECK_EXCEPTION();
ZEND_VM_NEXT_OPCODE();
@@ -3937,13 +3941,14 @@ ZEND_VM_HANDLER(74, ZEND_UNSET_VAR, CONST|TMP|VAR|CV, UNUSED|CONST|VAR)
} else {
ce = EX_T(opline->op2.var).class_entry;
}
- zend_std_unset_static_property(ce, Z_STRVAL_P(varname), Z_STRLEN_P(varname), ((OP1_TYPE == IS_CONST) ? opline->op1.literal : NULL) TSRMLS_CC);
+ result = zend_std_unset_static_property(ce, Z_STRVAL_P(varname), Z_STRLEN_P(varname), ((OP1_TYPE == IS_CONST) ? opline->op1.literal : NULL) TSRMLS_CC);
} else {
ulong hash_value = zend_inline_hash_func(varname->value.str.val, varname->value.str.len+1);
target_symbol_table = zend_get_target_symbol_table(opline->extended_value & ZEND_FETCH_TYPE_MASK TSRMLS_CC);
- zend_delete_variable(execute_data, target_symbol_table, varname->value.str.val, varname->value.str.len+1, hash_value TSRMLS_CC);
+ result = zend_delete_variable(execute_data, target_symbol_table, varname->value.str.val, varname->value.str.len+1, hash_value TSRMLS_CC);
}
+ ZVAL_BOOL(&EX_T(opline->result.var).tmp_var, result==SUCCESS?1:0);
if (OP1_TYPE != IS_CONST && varname == &tmp) {
zval_dtor(&tmp);
@@ -3962,6 +3967,7 @@ ZEND_VM_HANDLER(75, ZEND_UNSET_DIM, VAR|UNUSED|CV, CONST|TMP|VAR|CV)
zval **container;
zval *offset;
ulong hval;
+ int result = FAILURE;
SAVE_OPLINE();
container = GET_OP1_OBJ_ZVAL_PTR_PTR(BP_VAR_UNSET);
@@ -3978,13 +3984,13 @@ ZEND_VM_HANDLER(75, ZEND_UNSET_DIM, VAR|UNUSED|CV, CONST|TMP|VAR|CV)
switch (Z_TYPE_P(offset)) {
case IS_DOUBLE:
hval = zend_dval_to_lval(Z_DVAL_P(offset));
- zend_hash_index_del(ht, hval);
+ result = zend_hash_index_del(ht, hval);
break;
case IS_RESOURCE:
case IS_BOOL:
case IS_LONG:
hval = Z_LVAL_P(offset);
- zend_hash_index_del(ht, hval);
+ result = zend_hash_index_del(ht, hval);
break;
case IS_STRING:
if (OP2_TYPE == IS_CV || OP2_TYPE == IS_VAR) {
@@ -4001,22 +4007,22 @@ ZEND_VM_HANDLER(75, ZEND_UNSET_DIM, VAR|UNUSED|CV, CONST|TMP|VAR|CV)
}
}
if (ht == &EG(symbol_table)) {
- zend_delete_global_variable_ex(offset->value.str.val, offset->value.str.len, hval TSRMLS_CC);
+ result = zend_delete_global_variable_ex(offset->value.str.val, offset->value.str.len, hval TSRMLS_CC);
} else {
- zend_hash_quick_del(ht, Z_STRVAL_P(offset), Z_STRLEN_P(offset)+1, hval);
+ result = zend_hash_quick_del(ht, Z_STRVAL_P(offset), Z_STRLEN_P(offset)+1, hval);
}
if (OP2_TYPE == IS_CV || OP2_TYPE == IS_VAR) {
zval_ptr_dtor(&offset);
}
break;
ZEND_VM_C_LABEL(num_index_dim):
- zend_hash_index_del(ht, hval);
+ result = zend_hash_index_del(ht, hval);
if (OP2_TYPE == IS_CV || OP2_TYPE == IS_VAR) {
zval_ptr_dtor(&offset);
}
break;
case IS_NULL:
- zend_hash_del(ht, "", sizeof(""));
+ result = zend_hash_del(ht, "", sizeof(""));
break;
default:
zend_error(E_WARNING, "Illegal offset type in unset");
@@ -4032,8 +4038,8 @@ ZEND_VM_C_LABEL(num_index_dim):
if (IS_OP2_TMP_FREE()) {
MAKE_REAL_ZVAL_PTR(offset);
}
- Z_OBJ_HT_P(*container)->unset_dimension(*container, offset TSRMLS_CC);
- if (IS_OP2_TMP_FREE()) {
+ result = Z_OBJ_HT_P(*container)->unset_dimension(*container, offset TSRMLS_CC);
+ if ((result = IS_OP2_TMP_FREE()?SUCCESS:FAILURE) == SUCCESS) {
zval_ptr_dtor(&offset);
} else {
FREE_OP2();
@@ -4043,14 +4049,18 @@ ZEND_VM_C_LABEL(num_index_dim):
zend_error_noreturn(E_ERROR, "Cannot unset string offsets");
ZEND_VM_CONTINUE(); /* bailed out before */
default:
+ result = FAILURE;
FREE_OP2();
break;
}
} else {
+ result = FAILURE;
FREE_OP2();
}
FREE_OP1_VAR_PTR();
+ ZVAL_BOOL(&EX_T(opline->result.var).tmp_var, result==SUCCESS?1:0);
+
CHECK_EXCEPTION();
ZEND_VM_NEXT_OPCODE();
}
@@ -4061,6 +4071,7 @@ ZEND_VM_HANDLER(76, ZEND_UNSET_OBJ, VAR|UNUSED|CV, CONST|TMP|VAR|CV)
zend_free_op free_op1, free_op2;
zval **container;
zval *offset;
+ int result = FAILURE;
SAVE_OPLINE();
container = GET_OP1_OBJ_ZVAL_PTR_PTR(BP_VAR_UNSET);
@@ -4075,8 +4086,9 @@ ZEND_VM_HANDLER(76, ZEND_UNSET_OBJ, VAR|UNUSED|CV, CONST|TMP|VAR|CV)
MAKE_REAL_ZVAL_PTR(offset);
}
if (Z_OBJ_HT_P(*container)->unset_property) {
- Z_OBJ_HT_P(*container)->unset_property(*container, offset, ((OP2_TYPE == IS_CONST) ? opline->op2.literal : NULL) TSRMLS_CC);
+ result = Z_OBJ_HT_P(*container)->unset_property(*container, offset, ((OP2_TYPE == IS_CONST) ? opline->op2.literal : NULL) TSRMLS_CC);
} else {
+ result = FAILURE;
zend_error(E_NOTICE, "Trying to unset property of non-object");
}
if (IS_OP2_TMP_FREE()) {
@@ -4085,6 +4097,7 @@ ZEND_VM_HANDLER(76, ZEND_UNSET_OBJ, VAR|UNUSED|CV, CONST|TMP|VAR|CV)
FREE_OP2();
}
} else {
+ result = FAILURE;
FREE_OP2();
}
} else {
@@ -4092,6 +4105,8 @@ ZEND_VM_HANDLER(76, ZEND_UNSET_OBJ, VAR|UNUSED|CV, CONST|TMP|VAR|CV)
}
FREE_OP1_VAR_PTR();
+ ZVAL_BOOL(&EX_T(opline->result.var).tmp_var, result==SUCCESS?1:0);
+
CHECK_EXCEPTION();
ZEND_VM_NEXT_OPCODE();
}
View
468 Zend/zend_vm_execute.h
@@ -3874,6 +3874,7 @@ static int ZEND_FASTCALL ZEND_UNSET_VAR_SPEC_CONST_CONST_HANDLER(ZEND_OPCODE_HA
zval tmp, *varname;
HashTable *target_symbol_table;
+ int result = FAILURE;
SAVE_OPLINE();
if (IS_CONST == IS_CV &&
@@ -3882,12 +3883,14 @@ static int ZEND_FASTCALL ZEND_UNSET_VAR_SPEC_CONST_CONST_HANDLER(ZEND_OPCODE_HA
if (EG(active_symbol_table)) {
zend_compiled_variable *cv = &CV_DEF_OF(opline->op1.var);
- zend_delete_variable(EX(prev_execute_data), EG(active_symbol_table), cv->name, cv->name_len+1, cv->hash_value TSRMLS_CC);
+ result = zend_delete_variable(EX(prev_execute_data), EG(active_symbol_table), cv->name, cv->name_len+1, cv->hash_value TSRMLS_CC);
EX_CV(opline->op1.var) = NULL;
} else if (EX_CV(opline->op1.var)) {
zval_ptr_dtor(EX_CV(opline->op1.var));
+ result = SUCCESS;
EX_CV(opline->op1.var) = NULL;
}
+ ZVAL_BOOL(&EX_T(opline->result.var).tmp_var, result==SUCCESS?1:0);
CHECK_EXCEPTION();
ZEND_VM_NEXT_OPCODE();
}
@@ -3917,6 +3920,7 @@ static int ZEND_FASTCALL ZEND_UNSET_VAR_SPEC_CONST_CONST_HANDLER(ZEND_OPCODE_HA
} else if (IS_CONST == IS_VAR || IS_CONST == IS_CV) {
zval_ptr_dtor(&varname);
}
+ ZVAL_BOOL(&EX_T(opline->result.var).tmp_var, 0);
CHECK_EXCEPTION();
ZEND_VM_NEXT_OPCODE();
@@ -3926,13 +3930,14 @@ static int ZEND_FASTCALL ZEND_UNSET_VAR_SPEC_CONST_CONST_HANDLER(ZEND_OPCODE_HA
} else {
ce = EX_T(opline->op2.var).class_entry;
}
- zend_std_unset_static_property(ce, Z_STRVAL_P(varname), Z_STRLEN_P(varname), ((IS_CONST == IS_CONST) ? opline->op1.literal : NULL) TSRMLS_CC);
+ result = zend_std_unset_static_property(ce, Z_STRVAL_P(varname), Z_STRLEN_P(varname), ((IS_CONST == IS_CONST) ? opline->op1.literal : NULL) TSRMLS_CC);
} else {
ulong hash_value = zend_inline_hash_func(varname->value.str.val, varname->value.str.len+1);
target_symbol_table = zend_get_target_symbol_table(opline->extended_value & ZEND_FETCH_TYPE_MASK TSRMLS_CC);
- zend_delete_variable(execute_data, target_symbol_table, varname->value.str.val, varname->value.str.len+1, hash_value TSRMLS_CC);
+ result = zend_delete_variable(execute_data, target_symbol_table, varname->value.str.val, varname->value.str.len+1, hash_value TSRMLS_CC);
}
+ ZVAL_BOOL(&EX_T(opline->result.var).tmp_var, result==SUCCESS?1:0);
if (IS_CONST != IS_CONST && varname == &tmp) {
zval_dtor(&tmp);
@@ -5635,6 +5640,7 @@ static int ZEND_FASTCALL ZEND_UNSET_VAR_SPEC_CONST_VAR_HANDLER(ZEND_OPCODE_HAND
zval tmp, *varname;
HashTable *target_symbol_table;
+ int result = FAILURE;
SAVE_OPLINE();
if (IS_CONST == IS_CV &&
@@ -5643,12 +5649,14 @@ static int ZEND_FASTCALL ZEND_UNSET_VAR_SPEC_CONST_VAR_HANDLER(ZEND_OPCODE_HAND
if (EG(active_symbol_table)) {
zend_compiled_variable *cv = &CV_DEF_OF(opline->op1.var);
- zend_delete_variable(EX(prev_execute_data), EG(active_symbol_table), cv->name, cv->name_len+1, cv->hash_value TSRMLS_CC);
+ result = zend_delete_variable(EX(prev_execute_data), EG(active_symbol_table), cv->name, cv->name_len+1, cv->hash_value TSRMLS_CC);
EX_CV(opline->op1.var) = NULL;
} else if (EX_CV(opline->op1.var)) {
zval_ptr_dtor(EX_CV(opline->op1.var));
+ result = SUCCESS;
EX_CV(opline->op1.var) = NULL;
}
+ ZVAL_BOOL(&EX_T(opline->result.var).tmp_var, result==SUCCESS?1:0);
CHECK_EXCEPTION();
ZEND_VM_NEXT_OPCODE();
}
@@ -5678,6 +5686,7 @@ static int ZEND_FASTCALL ZEND_UNSET_VAR_SPEC_CONST_VAR_HANDLER(ZEND_OPCODE_HAND
} else if (IS_CONST == IS_VAR || IS_CONST == IS_CV) {
zval_ptr_dtor(&varname);
}
+ ZVAL_BOOL(&EX_T(opline->result.var).tmp_var, 0);
CHECK_EXCEPTION();
ZEND_VM_NEXT_OPCODE();
@@ -5687,13 +5696,14 @@ static int ZEND_FASTCALL ZEND_UNSET_VAR_SPEC_CONST_VAR_HANDLER(ZEND_OPCODE_HAND
} else {
ce = EX_T(opline->op2.var).class_entry;
}
- zend_std_unset_static_property(ce, Z_STRVAL_P(varname), Z_STRLEN_P(varname), ((IS_CONST == IS_CONST) ? opline->op1.literal : NULL) TSRMLS_CC);
+ result = zend_std_unset_static_property(ce, Z_STRVAL_P(varname), Z_STRLEN_P(varname), ((IS_CONST == IS_CONST) ? opline->op1.literal : NULL) TSRMLS_CC);
} else {
ulong hash_value = zend_inline_hash_func(varname->value.str.val, varname->value.str.len+1);
target_symbol_table = zend_get_target_symbol_table(opline->extended_value & ZEND_FETCH_TYPE_MASK TSRMLS_CC);
- zend_delete_variable(execute_data, target_symbol_table, varname->value.str.val, varname->value.str.len+1, hash_value TSRMLS_CC);
+ result = zend_delete_variable(execute_data, target_symbol_table, varname->value.str.val, varname->value.str.len+1, hash_value TSRMLS_CC);
}
+ ZVAL_BOOL(&EX_T(opline->result.var).tmp_var, result==SUCCESS?1:0);
if (IS_CONST != IS_CONST && varname == &tmp) {
zval_dtor(&tmp);
@@ -6335,6 +6345,7 @@ static int ZEND_FASTCALL ZEND_UNSET_VAR_SPEC_CONST_UNUSED_HANDLER(ZEND_OPCODE_H
zval tmp, *varname;
HashTable *target_symbol_table;
+ int result = FAILURE;
SAVE_OPLINE();
if (IS_CONST == IS_CV &&
@@ -6343,12 +6354,14 @@ static int ZEND_FASTCALL ZEND_UNSET_VAR_SPEC_CONST_UNUSED_HANDLER(ZEND_OPCODE_H
if (EG(active_symbol_table)) {
zend_compiled_variable *cv = &CV_DEF_OF(opline->op1.var);
- zend_delete_variable(EX(prev_execute_data), EG(active_symbol_table), cv->name, cv->name_len+1, cv->hash_value TSRMLS_CC);
+ result = zend_delete_variable(EX(prev_execute_data), EG(active_symbol_table), cv->name, cv->name_len+1, cv->hash_value TSRMLS_CC);
EX_CV(opline->op1.var) = NULL;
} else if (EX_CV(opline->op1.var)) {
zval_ptr_dtor(EX_CV(opline->op1.var));
+ result = SUCCESS;
EX_CV(opline->op1.var) = NULL;
}
+ ZVAL_BOOL(&EX_T(opline->result.var).tmp_var, result==SUCCESS?1:0);
CHECK_EXCEPTION();
ZEND_VM_NEXT_OPCODE();
}
@@ -6378,6 +6391,7 @@ static int ZEND_FASTCALL ZEND_UNSET_VAR_SPEC_CONST_UNUSED_HANDLER(ZEND_OPCODE_H
} else if (IS_CONST == IS_VAR || IS_CONST == IS_CV) {
zval_ptr_dtor(&varname);
}
+ ZVAL_BOOL(&EX_T(opline->result.var).tmp_var, 0);
CHECK_EXCEPTION();
ZEND_VM_NEXT_OPCODE();
@@ -6387,13 +6401,14 @@ static int ZEND_FASTCALL ZEND_UNSET_VAR_SPEC_CONST_UNUSED_HANDLER(ZEND_OPCODE_H
} else {
ce = EX_T(opline->op2.var).class_entry;
}
- zend_std_unset_static_property(ce, Z_STRVAL_P(varname), Z_STRLEN_P(varname), ((IS_CONST == IS_CONST) ? opline->op1.literal : NULL) TSRMLS_CC);
+ result = zend_std_unset_static_property(ce, Z_STRVAL_P(varname), Z_STRLEN_P(varname), ((IS_CONST == IS_CONST) ? opline->op1.literal : NULL) TSRMLS_CC);
} else {
ulong hash_value = zend_inline_hash_func(varname->value.str.val, varname->value.str.len+1);
target_symbol_table = zend_get_target_symbol_table(opline->extended_value & ZEND_FETCH_TYPE_MASK TSRMLS_CC);
- zend_delete_variable(execute_data, target_symbol_table, varname->value.str.val, varname->value.str.len+1, hash_value TSRMLS_CC);
+ result = zend_delete_variable(execute_data, target_symbol_table, varname->value.str.val, varname->value.str.len+1, hash_value TSRMLS_CC);
}
+ ZVAL_BOOL(&EX_T(opline->result.var).tmp_var, result==SUCCESS?1:0);
if (IS_CONST != IS_CONST && varname == &tmp) {
zval_dtor(&tmp);
@@ -9157,6 +9172,7 @@ static int ZEND_FASTCALL ZEND_UNSET_VAR_SPEC_TMP_CONST_HANDLER(ZEND_OPCODE_HAND
zval tmp, *varname;
HashTable *target_symbol_table;
zend_free_op free_op1;
+ int result = FAILURE;
SAVE_OPLINE();
if (IS_TMP_VAR == IS_CV &&
@@ -9165,12 +9181,14 @@ static int ZEND_FASTCALL ZEND_UNSET_VAR_SPEC_TMP_CONST_HANDLER(ZEND_OPCODE_HAND
if (EG(active_symbol_table)) {
zend_compiled_variable *cv = &CV_DEF_OF(opline->op1.var);
- zend_delete_variable(EX(prev_execute_data), EG(active_symbol_table), cv->name, cv->name_len+1, cv->hash_value TSRMLS_CC);
+ result = zend_delete_variable(EX(prev_execute_data), EG(active_symbol_table), cv->name, cv->name_len+1, cv->hash_value TSRMLS_CC);
EX_CV(opline->op1.var) = NULL;
} else if (EX_CV(opline->op1.var)) {
zval_ptr_dtor(EX_CV(opline->op1.var));
+ result = SUCCESS;
EX_CV(opline->op1.var) = NULL;
}
+ ZVAL_BOOL(&EX_T(opline->result.var).tmp_var, result==SUCCESS?1:0);
CHECK_EXCEPTION();
ZEND_VM_NEXT_OPCODE();
}
@@ -9200,6 +9218,7 @@ static int ZEND_FASTCALL ZEND_UNSET_VAR_SPEC_TMP_CONST_HANDLER(ZEND_OPCODE_HAND
} else if (IS_TMP_VAR == IS_VAR || IS_TMP_VAR == IS_CV) {
zval_ptr_dtor(&varname);
}
+ ZVAL_BOOL(&EX_T(opline->result.var).tmp_var, 0);
zval_dtor(free_op1.var);
CHECK_EXCEPTION();
ZEND_VM_NEXT_OPCODE();
@@ -9209,13 +9228,14 @@ static int ZEND_FASTCALL ZEND_UNSET_VAR_SPEC_TMP_CONST_HANDLER(ZEND_OPCODE_HAND
} else {
ce = EX_T(opline->op2.var).class_entry;
}
- zend_std_unset_static_property(ce, Z_STRVAL_P(varname), Z_STRLEN_P(varname), ((IS_TMP_VAR == IS_CONST) ? opline->op1.literal : NULL) TSRMLS_CC);
+ result = zend_std_unset_static_property(ce, Z_STRVAL_P(varname), Z_STRLEN_P(varname), ((IS_TMP_VAR == IS_CONST) ? opline->op1.literal : NULL) TSRMLS_CC);
} else {
ulong hash_value = zend_inline_hash_func(varname->value.str.val, varname->value.str.len+1);
target_symbol_table = zend_get_target_symbol_table(opline->extended_value & ZEND_FETCH_TYPE_MASK TSRMLS_CC);
- zend_delete_variable(execute_data, target_symbol_table, varname->value.str.val, varname->value.str.len+1, hash_value TSRMLS_CC);
+ result = zend_delete_variable(execute_data, target_symbol_table, varname->value.str.val, varname->value.str.len+1, hash_value TSRMLS_CC);
}
+ ZVAL_BOOL(&EX_T(opline->result.var).tmp_var, result==SUCCESS?1:0);
if (IS_TMP_VAR != IS_CONST && varname == &tmp) {
zval_dtor(&tmp);
@@ -10886,6 +10906,7 @@ static int ZEND_FASTCALL ZEND_UNSET_VAR_SPEC_TMP_VAR_HANDLER(ZEND_OPCODE_HANDLE
zval tmp, *varname;
HashTable *target_symbol_table;
zend_free_op free_op1;
+ int result = FAILURE;
SAVE_OPLINE();
if (IS_TMP_VAR == IS_CV &&
@@ -10894,12 +10915,14 @@ static int ZEND_FASTCALL ZEND_UNSET_VAR_SPEC_TMP_VAR_HANDLER(ZEND_OPCODE_HANDLE
if (EG(active_symbol_table)) {
zend_compiled_variable *cv = &CV_DEF_OF(opline->op1.var);
- zend_delete_variable(EX(prev_execute_data), EG(active_symbol_table), cv->name, cv->name_len+1, cv->hash_value TSRMLS_CC);
+ result = zend_delete_variable(EX(prev_execute_data), EG(active_symbol_table), cv->name, cv->name_len+1, cv->hash_value TSRMLS_CC);
EX_CV(opline->op1.var) = NULL;
} else if (EX_CV(opline->op1.var)) {
zval_ptr_dtor(EX_CV(opline->op1.var));
+ result = SUCCESS;
EX_CV(opline->op1.var) = NULL;
}
+ ZVAL_BOOL(&EX_T(opline->result.var).tmp_var, result==SUCCESS?1:0);
CHECK_EXCEPTION();
ZEND_VM_NEXT_OPCODE();
}
@@ -10929,6 +10952,7 @@ static int ZEND_FASTCALL ZEND_UNSET_VAR_SPEC_TMP_VAR_HANDLER(ZEND_OPCODE_HANDLE
} else if (IS_TMP_VAR == IS_VAR || IS_TMP_VAR == IS_CV) {
zval_ptr_dtor(&varname);
}
+ ZVAL_BOOL(&EX_T(opline->result.var).tmp_var, 0);
zval_dtor(free_op1.var);
CHECK_EXCEPTION();
ZEND_VM_NEXT_OPCODE();
@@ -10938,13 +10962,14 @@ static int ZEND_FASTCALL ZEND_UNSET_VAR_SPEC_TMP_VAR_HANDLER(ZEND_OPCODE_HANDLE
} else {
ce = EX_T(opline->op2.var).class_entry;
}
- zend_std_unset_static_property(ce, Z_STRVAL_P(varname), Z_STRLEN_P(varname), ((IS_TMP_VAR == IS_CONST) ? opline->op1.literal : NULL) TSRMLS_CC);
+ result = zend_std_unset_static_property(ce, Z_STRVAL_P(varname), Z_STRLEN_P(varname), ((IS_TMP_VAR == IS_CONST) ? opline->op1.literal : NULL) TSRMLS_CC);
} else {
ulong hash_value = zend_inline_hash_func(varname->value.str.val, varname->value.str.len+1);
target_symbol_table = zend_get_target_symbol_table(opline->extended_value & ZEND_FETCH_TYPE_MASK TSRMLS_CC);
- zend_delete_variable(execute_data, target_symbol_table, varname->value.str.val, varname->value.str.len+1, hash_value TSRMLS_CC);
+ result = zend_delete_variable(execute_data, target_symbol_table, varname->value.str.val, varname->value.str.len+1, hash_value TSRMLS_CC);
}
+ ZVAL_BOOL(&EX_T(opline->result.var).tmp_var, result==SUCCESS?1:0);
if (IS_TMP_VAR != IS_CONST && varname == &tmp) {
zval_dtor(&tmp);
@@ -11465,6 +11490,7 @@ static int ZEND_FASTCALL ZEND_UNSET_VAR_SPEC_TMP_UNUSED_HANDLER(ZEND_OPCODE_HAN
zval tmp, *varname;
HashTable *target_symbol_table;
zend_free_op free_op1;
+ int result = FAILURE;
SAVE_OPLINE();
if (IS_TMP_VAR == IS_CV &&
@@ -11473,12 +11499,14 @@ static int ZEND_FASTCALL ZEND_UNSET_VAR_SPEC_TMP_UNUSED_HANDLER(ZEND_OPCODE_HAN
if (EG(active_symbol_table)) {
zend_compiled_variable *cv = &CV_DEF_OF(opline->op1.var);
- zend_delete_variable(EX(prev_execute_data), EG(active_symbol_table), cv->name, cv->name_len+1, cv->hash_value TSRMLS_CC);
+ result = zend_delete_variable(EX(prev_execute_data), EG(active_symbol_table), cv->name, cv->name_len+1, cv->hash_value TSRMLS_CC);
EX_CV(opline->op1.var) = NULL;
} else if (EX_CV(opline->op1.var)) {
zval_ptr_dtor(EX_CV(opline->op1.var));
+ result = SUCCESS;
EX_CV(opline->op1.var) = NULL;
}
+ ZVAL_BOOL(&EX_T(opline->result.var).tmp_var, result==SUCCESS?1:0);
CHECK_EXCEPTION();
ZEND_VM_NEXT_OPCODE();
}
@@ -11508,6 +11536,7 @@ static int ZEND_FASTCALL ZEND_UNSET_VAR_SPEC_TMP_UNUSED_HANDLER(ZEND_OPCODE_HAN
} else if (IS_TMP_VAR == IS_VAR || IS_TMP_VAR == IS_CV) {
zval_ptr_dtor(&varname);
}
+ ZVAL_BOOL(&EX_T(opline->result.var).tmp_var, 0);
zval_dtor(free_op1.var);
CHECK_EXCEPTION();
ZEND_VM_NEXT_OPCODE();
@@ -11517,13 +11546,14 @@ static int ZEND_FASTCALL ZEND_UNSET_VAR_SPEC_TMP_UNUSED_HANDLER(ZEND_OPCODE_HAN
} else {
ce = EX_T(opline->op2.var).class_entry;
}
- zend_std_unset_static_property(ce, Z_STRVAL_P(varname), Z_STRLEN_P(varname), ((IS_TMP_VAR == IS_CONST) ? opline->op1.literal : NULL) TSRMLS_CC);
+ result = zend_std_unset_static_property(ce, Z_STRVAL_P(varname), Z_STRLEN_P(varname), ((IS_TMP_VAR == IS_CONST) ? opline->op1.literal : NULL) TSRMLS_CC);
} else {
ulong hash_value = zend_inline_hash_func(varname->value.str.val, varname->value.str.len+1);
target_symbol_table = zend_get_target_symbol_table(opline->extended_value & ZEND_FETCH_TYPE_MASK TSRMLS_CC);
- zend_delete_variable(execute_data, target_symbol_table, varname->value.str.val, varname->value.str.len+1, hash_value TSRMLS_CC);
+ result = zend_delete_variable(execute_data, target_symbol_table, varname->value.str.val, varname->value.str.len+1, hash_value TSRMLS_CC);
}
+ ZVAL_BOOL(&EX_T(opline->result.var).tmp_var, result==SUCCESS?1:0);
if (IS_TMP_VAR != IS_CONST && varname == &tmp) {
zval_dtor(&tmp);
@@ -15781,6 +15811,7 @@ static int ZEND_FASTCALL ZEND_UNSET_VAR_SPEC_VAR_CONST_HANDLER(ZEND_OPCODE_HAND
zval tmp, *varname;
HashTable *target_symbol_table;
zend_free_op free_op1;
+ int result = FAILURE;
SAVE_OPLINE();
if (IS_VAR == IS_CV &&
@@ -15789,12 +15820,14 @@ static int ZEND_FASTCALL ZEND_UNSET_VAR_SPEC_VAR_CONST_HANDLER(ZEND_OPCODE_HAND
if (EG(active_symbol_table)) {
zend_compiled_variable *cv = &CV_DEF_OF(opline->op1.var);
- zend_delete_variable(EX(prev_execute_data), EG(active_symbol_table), cv->name, cv->name_len+1, cv->hash_value TSRMLS_CC);
+ result = zend_delete_variable(EX(prev_execute_data), EG(active_symbol_table), cv->name, cv->name_len+1, cv->hash_value TSRMLS_CC);
EX_CV(opline->op1.var) = NULL;
} else if (EX_CV(opline->op1.var)) {
zval_ptr_dtor(EX_CV(opline->op1.var));
+ result = SUCCESS;
EX_CV(opline->op1.var) = NULL;
}
+ ZVAL_BOOL(&EX_T(opline->result.var).tmp_var, result==SUCCESS?1:0);
CHECK_EXCEPTION();
ZEND_VM_NEXT_OPCODE();
}
@@ -15824,6 +15857,7 @@ static int ZEND_FASTCALL ZEND_UNSET_VAR_SPEC_VAR_CONST_HANDLER(ZEND_OPCODE_HAND
} else if (IS_VAR == IS_VAR || IS_VAR == IS_CV) {
zval_ptr_dtor(&varname);
}
+ ZVAL_BOOL(&EX_T(opline->result.var).tmp_var, 0);
if (free_op1.var) {zval_ptr_dtor(&free_op1.var);};
CHECK_EXCEPTION();
ZEND_VM_NEXT_OPCODE();
@@ -15833,13 +15867,14 @@ static int ZEND_FASTCALL ZEND_UNSET_VAR_SPEC_VAR_CONST_HANDLER(ZEND_OPCODE_HAND
} else {
ce = EX_T(opline->op2.var).class_entry;
}
- zend_std_unset_static_property(ce, Z_STRVAL_P(varname), Z_STRLEN_P(varname), ((IS_VAR == IS_CONST) ? opline->op1.literal : NULL) TSRMLS_CC);
+ result = zend_std_unset_static_property(ce, Z_STRVAL_P(varname), Z_STRLEN_P(varname), ((IS_VAR == IS_CONST) ? opline->op1.literal : NULL) TSRMLS_CC);
} else {
ulong hash_value = zend_inline_hash_func(varname->value.str.val, varname->value.str.len+1);
target_symbol_table = zend_get_target_symbol_table(opline->extended_value & ZEND_FETCH_TYPE_MASK TSRMLS_CC);
- zend_delete_variable(execute_data, target_symbol_table, varname->value.str.val, varname->value.str.len+1, hash_value TSRMLS_CC);
+ result = zend_delete_variable(execute_data, target_symbol_table, varname->value.str.val, varname->value.str.len+1, hash_value TSRMLS_CC);
}
+ ZVAL_BOOL(&EX_T(opline->result.var).tmp_var, result==SUCCESS?1:0);
if (IS_VAR != IS_CONST && varname == &tmp) {
zval_dtor(&tmp);
@@ -15858,6 +15893,7 @@ static int ZEND_FASTCALL ZEND_UNSET_DIM_SPEC_VAR_CONST_HANDLER(ZEND_OPCODE_HAND
zval **container;
zval *offset;
ulong hval;
+ int result = FAILURE;
SAVE_OPLINE();
container = _get_zval_ptr_ptr_var(opline->op1.var, execute_data, &free_op1 TSRMLS_CC);
@@ -15874,13 +15910,13 @@ static int ZEND_FASTCALL ZEND_UNSET_DIM_SPEC_VAR_CONST_HANDLER(ZEND_OPCODE_HAND
switch (Z_TYPE_P(offset)) {
case IS_DOUBLE:
hval = zend_dval_to_lval(Z_DVAL_P(offset));
- zend_hash_index_del(ht, hval);
+ result = zend_hash_index_del(ht, hval);
break;
case IS_RESOURCE:
case IS_BOOL:
case IS_LONG:
hval = Z_LVAL_P(offset);
- zend_hash_index_del(ht, hval);
+ result = zend_hash_index_del(ht, hval);
break;
case IS_STRING:
if (IS_CONST == IS_CV || IS_CONST == IS_VAR) {
@@ -15897,22 +15933,22 @@ static int ZEND_FASTCALL ZEND_UNSET_DIM_SPEC_VAR_CONST_HANDLER(ZEND_OPCODE_HAND
}
}
if (ht == &EG(symbol_table)) {
- zend_delete_global_variable_ex(offset->value.str.val, offset->value.str.len, hval TSRMLS_CC);
+ result = zend_delete_global_variable_ex(offset->value.str.val, offset->value.str.len, hval TSRMLS_CC);
} else {
- zend_hash_quick_del(ht, Z_STRVAL_P(offset), Z_STRLEN_P(offset)+1, hval);
+ result = zend_hash_quick_del(ht, Z_STRVAL_P(offset), Z_STRLEN_P(offset)+1, hval);
}
if (IS_CONST == IS_CV || IS_CONST == IS_VAR) {
zval_ptr_dtor(&offset);
}
break;
num_index_dim:
- zend_hash_index_del(ht, hval);
+ result = zend_hash_index_del(ht, hval);
if (IS_CONST == IS_CV || IS_CONST == IS_VAR) {
zval_ptr_dtor(&offset);
}
break;
case IS_NULL:
- zend_hash_del(ht, "", sizeof(""));
+ result = zend_hash_del(ht, "", sizeof(""));
break;
default:
zend_error(E_WARNING, "Illegal offset type in unset");
@@ -15928,8 +15964,8 @@ static int ZEND_FASTCALL ZEND_UNSET_DIM_SPEC_VAR_CONST_HANDLER(ZEND_OPCODE_HAND
if (0) {
MAKE_REAL_ZVAL_PTR(offset);
}
- Z_OBJ_HT_P(*container)->unset_dimension(*container, offset TSRMLS_CC);
- if (0) {
+ result = Z_OBJ_HT_P(*container)->unset_dimension(*container, offset TSRMLS_CC);
+ if ((result = 0?SUCCESS:FAILURE) == SUCCESS) {
zval_ptr_dtor(&offset);
} else {
@@ -15939,14 +15975,18 @@ static int ZEND_FASTCALL ZEND_UNSET_DIM_SPEC_VAR_CONST_HANDLER(ZEND_OPCODE_HAND
zend_error_noreturn(E_ERROR, "Cannot unset string offsets");
ZEND_VM_CONTINUE(); /* bailed out before */
default:
+ result = FAILURE;
break;
}
} else {
+ result = FAILURE;
}
if (free_op1.var) {zval_ptr_dtor(&free_op1.var);};
+ ZVAL_BOOL(&EX_T(opline->result.var).tmp_var, result==SUCCESS?1:0);
+
CHECK_EXCEPTION();
ZEND_VM_NEXT_OPCODE();
}
@@ -15957,6 +15997,7 @@ static int ZEND_FASTCALL ZEND_UNSET_OBJ_SPEC_VAR_CONST_HANDLER(ZEND_OPCODE_HAND
zend_free_op free_op1;
zval **container;
zval *offset;
+ int result = FAILURE;
SAVE_OPLINE();
container = _get_zval_ptr_ptr_var(opline->op1.var, execute_data, &free_op1 TSRMLS_CC);
@@ -15971,8 +16012,9 @@ static int ZEND_FASTCALL ZEND_UNSET_OBJ_SPEC_VAR_CONST_HANDLER(ZEND_OPCODE_HAND
MAKE_REAL_ZVAL_PTR(offset);
}
if (Z_OBJ_HT_P(*container)->unset_property) {
- Z_OBJ_HT_P(*container)->unset_property(*container, offset, ((IS_CONST == IS_CONST) ? opline->op2.literal : NULL) TSRMLS_CC);
+ result = Z_OBJ_HT_P(*container)->unset_property(*container, offset, ((IS_CONST == IS_CONST) ? opline->op2.literal : NULL) TSRMLS_CC);
} else {
+ result = FAILURE;
zend_error(E_NOTICE, "Trying to unset property of non-object");
}
if (0) {
@@ -15981,6 +16023,7 @@ static int ZEND_FASTCALL ZEND_UNSET_OBJ_SPEC_VAR_CONST_HANDLER(ZEND_OPCODE_HAND
}
} else {
+ result = FAILURE;
}
} else {
@@ -15988,6 +16031,8 @@ static int ZEND_FASTCALL ZEND_UNSET_OBJ_SPEC_VAR_CONST_HANDLER(ZEND_OPCODE_HAND
}
if (free_op1.var) {zval_ptr_dtor(&free_op1.var);};
+ ZVAL_BOOL(&EX_T(opline->result.var).tmp_var, result==SUCCESS?1:0);
+
CHECK_EXCEPTION();
ZEND_VM_NEXT_OPCODE();
}
@@ -18040,6 +18085,7 @@ static int ZEND_FASTCALL ZEND_UNSET_DIM_SPEC_VAR_TMP_HANDLER(ZEND_OPCODE_HANDLE
zval **container;
zval *offset;
ulong hval;
+ int result = FAILURE;
SAVE_OPLINE();
container = _get_zval_ptr_ptr_var(opline->op1.var, execute_data, &free_op1 TSRMLS_CC);
@@ -18056,13 +18102,13 @@ static int ZEND_FASTCALL ZEND_UNSET_DIM_SPEC_VAR_TMP_HANDLER(ZEND_OPCODE_HANDLE
switch (Z_TYPE_P(offset)) {
case IS_DOUBLE:
hval = zend_dval_to_lval(Z_DVAL_P(offset));
- zend_hash_index_del(ht, hval);
+ result = zend_hash_index_del(ht, hval);
break;
case IS_RESOURCE:
case IS_BOOL:
case IS_LONG:
hval = Z_LVAL_P(offset);
- zend_hash_index_del(ht, hval);
+ result = zend_hash_index_del(ht, hval);
break;
case IS_STRING:
if (IS_TMP_VAR == IS_CV || IS_TMP_VAR == IS_VAR) {
@@ -18079,22 +18125,22 @@ static int ZEND_FASTCALL ZEND_UNSET_DIM_SPEC_VAR_TMP_HANDLER(ZEND_OPCODE_HANDLE
}
}
if (ht == &EG(symbol_table)) {
- zend_delete_global_variable_ex(offset->value.str.val, offset->value.str.len, hval TSRMLS_CC);
+ result = zend_delete_global_variable_ex(offset->value.str.val, offset->value.str.len, hval TSRMLS_CC);
} else {
- zend_hash_quick_del(ht, Z_STRVAL_P(offset), Z_STRLEN_P(offset)+1, hval);
+ result = zend_hash_quick_del(ht, Z_STRVAL_P(offset), Z_STRLEN_P(offset)+1, hval);
}
if (IS_TMP_VAR == IS_CV || IS_TMP_VAR == IS_VAR) {
zval_ptr_dtor(&offset);
}
break;
num_index_dim:
- zend_hash_index_del(ht, hval);
+ result = zend_hash_index_del(ht, hval);
if (IS_TMP_VAR == IS_CV || IS_TMP_VAR == IS_VAR) {
zval_ptr_dtor(&offset);
}
break;
case IS_NULL:
- zend_hash_del(ht, "", sizeof(""));
+ result = zend_hash_del(ht, "", sizeof(""));
break;
default:
zend_error(E_WARNING, "Illegal offset type in unset");
@@ -18110,8 +18156,8 @@ static int ZEND_FASTCALL ZEND_UNSET_DIM_SPEC_VAR_TMP_HANDLER(ZEND_OPCODE_HANDLE
if (1) {
MAKE_REAL_ZVAL_PTR(offset);
}
- Z_OBJ_HT_P(*container)->unset_dimension(*container, offset TSRMLS_CC);
- if (1) {
+ result = Z_OBJ_HT_P(*container)->unset_dimension(*container, offset TSRMLS_CC);
+ if ((result = 1?SUCCESS:FAILURE) == SUCCESS) {
zval_ptr_dtor(&offset);
} else {
zval_dtor(free_op2.var);
@@ -18121,14 +18167,18 @@ static int ZEND_FASTCALL ZEND_UNSET_DIM_SPEC_VAR_TMP_HANDLER(ZEND_OPCODE_HANDLE
zend_error_noreturn(E_ERROR, "Cannot unset string offsets");
ZEND_VM_CONTINUE(); /* bailed out before */
default:
+ result = FAILURE;
zval_dtor(free_op2.var);
break;
}
} else {
+ result = FAILURE;
zval_dtor(free_op2.var);
}
if (free_op1.var) {zval_ptr_dtor(&free_op1.var);};
+ ZVAL_BOOL(&EX_T(opline->result.var).tmp_var, result==SUCCESS?1:0);
+
CHECK_EXCEPTION();
ZEND_VM_NEXT_OPCODE();
}
@@ -18139,6 +18189,7 @@ static int ZEND_FASTCALL ZEND_UNSET_OBJ_SPEC_VAR_TMP_HANDLER(ZEND_OPCODE_HANDLE
zend_free_op free_op1, free_op2;
zval **container;
zval *offset;
+ int result = FAILURE;
SAVE_OPLINE();
container = _get_zval_ptr_ptr_var(opline->op1.var, execute_data, &free_op1 TSRMLS_CC);
@@ -18153,8 +18204,9 @@ static int ZEND_FASTCALL ZEND_UNSET_OBJ_SPEC_VAR_TMP_HANDLER(ZEND_OPCODE_HANDLE
MAKE_REAL_ZVAL_PTR(offset);
}
if (Z_OBJ_HT_P(*container)->unset_property) {
- Z_OBJ_HT_P(*container)->unset_property(*container, offset, ((IS_TMP_VAR == IS_CONST) ? opline->op2.literal : NULL) TSRMLS_CC);
+ result = Z_OBJ_HT_P(*container)->unset_property(*container, offset, ((IS_TMP_VAR == IS_CONST) ? opline->op2.literal : NULL) TSRMLS_CC);
} else {
+ result = FAILURE;
zend_error(E_NOTICE, "Trying to unset property of non-object");
}
if (1) {
@@ -18163,6 +18215,7 @@ static int ZEND_FASTCALL ZEND_UNSET_OBJ_SPEC_VAR_TMP_HANDLER(ZEND_OPCODE_HANDLE
zval_dtor(free_op2.var);
}
} else {
+ result = FAILURE;
zval_dtor(free_op2.var);
}
} else {
@@ -18170,6 +18223,8 @@ static int ZEND_FASTCALL ZEND_UNSET_OBJ_SPEC_VAR_TMP_HANDLER(ZEND_OPCODE_HANDLE
}
if (free_op1.var) {zval_ptr_dtor(&free_op1.var);};
+ ZVAL_BOOL(&EX_T(opline->result.var).tmp_var, result==SUCCESS?1:0);
+
CHECK_EXCEPTION();
ZEND_VM_NEXT_OPCODE();
}
@@ -20355,6 +20410,7 @@ static int ZEND_FASTCALL ZEND_UNSET_VAR_SPEC_VAR_VAR_HANDLER(ZEND_OPCODE_HANDLE
zval tmp, *varname;
HashTable *target_symbol_table;
zend_free_op free_op1;
+ int result = FAILURE;
SAVE_OPLINE();
if (IS_VAR == IS_CV &&
@@ -20363,12 +20419,14 @@ static int ZEND_FASTCALL ZEND_UNSET_VAR_SPEC_VAR_VAR_HANDLER(ZEND_OPCODE_HANDLE
if (EG(active_symbol_table)) {
zend_compiled_variable *cv = &CV_DEF_OF(opline->op1.var);
- zend_delete_variable(EX(prev_execute_data), EG(active_symbol_table), cv->name, cv->name_len+1, cv->hash_value TSRMLS_CC);
+ result = zend_delete_variable(EX(prev_execute_data), EG(active_symbol_table), cv->name, cv->name_len+1, cv->hash_value TSRMLS_CC);
EX_CV(opline->op1.var) = NULL;
} else if (EX_CV(opline->op1.var)) {
zval_ptr_dtor(EX_CV(opline->op1.var));
+ result = SUCCESS;
EX_CV(opline->op1.var) = NULL;
}
+ ZVAL_BOOL(&EX_T(opline->result.var).tmp_var, result==SUCCESS?1:0);
CHECK_EXCEPTION();
ZEND_VM_NEXT_OPCODE();
}
@@ -20398,6 +20456,7 @@ static int ZEND_FASTCALL ZEND_UNSET_VAR_SPEC_VAR_VAR_HANDLER(ZEND_OPCODE_HANDLE
} else if (IS_VAR == IS_VAR || IS_VAR == IS_CV) {
zval_ptr_dtor(&varname);
}
+ ZVAL_BOOL(&EX_T(opline->result.var).tmp_var, 0);
if (free_op1.var) {zval_ptr_dtor(&free_op1.var);};
CHECK_EXCEPTION();
ZEND_VM_NEXT_OPCODE();
@@ -20407,13 +20466,14 @@ static int ZEND_FASTCALL ZEND_UNSET_VAR_SPEC_VAR_VAR_HANDLER(ZEND_OPCODE_HANDLE
} else {
ce = EX_T(opline->op2.var).class_entry;
}
- zend_std_unset_static_property(ce, Z_STRVAL_P(varname), Z_STRLEN_P(varname), ((IS_VAR == IS_CONST) ? opline->op1.literal : NULL) TSRMLS_CC);
+ result = zend_std_unset_static_property(ce, Z_STRVAL_P(varname), Z_STRLEN_P(varname), ((IS_VAR == IS_CONST) ? opline->op1.literal : NULL) TSRMLS_CC);
} else {
ulong hash_value = zend_inline_hash_func(varname->value.str.val, varname->value.str.len+1);
target_symbol_table = zend_get_target_symbol_table(opline->extended_value & ZEND_FETCH_TYPE_MASK TSRMLS_CC);
- zend_delete_variable(execute_data, target_symbol_table, varname->value.str.val, varname->value.str.len+1, hash_value TSRMLS_CC);
+ result = zend_delete_variable(execute_data, target_symbol_table, varname->value.str.val, varname->value.str.len+1, hash_value TSRMLS_CC);
}
+ ZVAL_BOOL(&EX_T(opline->result.var).tmp_var, result==SUCCESS?1:0);
if (IS_VAR != IS_CONST && varname == &tmp) {
zval_dtor(&tmp);
@@ -20432,6 +20492,7 @@ static int ZEND_FASTCALL ZEND_UNSET_DIM_SPEC_VAR_VAR_HANDLER(ZEND_OPCODE_HANDLE
zval **container;
zval *offset;
ulong hval;
+ int result = FAILURE;
SAVE_OPLINE();
container = _get_zval_ptr_ptr_var(opline->op1.var, execute_data, &free_op1 TSRMLS_CC);
@@ -20448,13 +20509,13 @@ static int ZEND_FASTCALL ZEND_UNSET_DIM_SPEC_VAR_VAR_HANDLER(ZEND_OPCODE_HANDLE
switch (Z_TYPE_P(offset)) {
case IS_DOUBLE:
hval = zend_dval_to_lval(Z_DVAL_P(offset));
- zend_hash_index_del(ht, hval);
+ result = zend_hash_index_del(ht, hval);
break;
case IS_RESOURCE:
case IS_BOOL:
case IS_LONG:
hval = Z_LVAL_P(offset);
- zend_hash_index_del(ht, hval);
+ result = zend_hash_index_del(ht, hval);
break;
case IS_STRING:
if (IS_VAR == IS_CV || IS_VAR == IS_VAR) {
@@ -20471,22 +20532,22 @@ static int ZEND_FASTCALL ZEND_UNSET_DIM_SPEC_VAR_VAR_HANDLER(ZEND_OPCODE_HANDLE
}
}
if (ht == &EG(symbol_table)) {
- zend_delete_global_variable_ex(offset->value.str.val, offset->value.str.len, hval TSRMLS_CC);
+ result = zend_delete_global_variable_ex(offset->value.str.val, offset->value.str.len, hval TSRMLS_CC);
} else {
- zend_hash_quick_del(ht, Z_STRVAL_P(offset), Z_STRLEN_P(offset)+1, hval);
+ result = zend_hash_quick_del(ht, Z_STRVAL_P(offset), Z_STRLEN_P(offset)+1, hval);
}
if (IS_VAR == IS_CV || IS_VAR == IS_VAR) {
zval_ptr_dtor(&offset);
}
break;
num_index_dim:
- zend_hash_index_del(ht, hval);
+ result = zend_hash_index_del(ht, hval);
if (IS_VAR == IS_CV || IS_VAR == IS_VAR) {
zval_ptr_dtor(&offset);
}
break;
case IS_NULL:
- zend_hash_del(ht, "", sizeof(""));
+ result = zend_hash_del(ht, "", sizeof(""));
break;
default:
zend_error(E_WARNING, "Illegal offset type in unset");
@@ -20502,8 +20563,8 @@ static int ZEND_FASTCALL ZEND_UNSET_DIM_SPEC_VAR_VAR_HANDLER(ZEND_OPCODE_HANDLE
if (0) {
MAKE_REAL_ZVAL_PTR(offset);
}
- Z_OBJ_HT_P(*container)->unset_dimension(*container, offset TSRMLS_CC);
- if (0) {
+ result = Z_OBJ_HT_P(*container)->unset_dimension(*container, offset TSRMLS_CC);
+ if ((result = 0?SUCCESS:FAILURE) == SUCCESS) {
zval_ptr_dtor(&offset);
} else {
if (free_op2.var) {zval_ptr_dtor(&free_op2.var);};
@@ -20513,14 +20574,18 @@ static int ZEND_FASTCALL ZEND_UNSET_DIM_SPEC_VAR_VAR_HANDLER(ZEND_OPCODE_HANDLE
zend_error_noreturn(E_ERROR, "Cannot unset string offsets");
ZEND_VM_CONTINUE(); /* bailed out before */
default:
+ result = FAILURE;
if (free_op2.var) {zval_ptr_dtor(&free_op2.var);};
break;
}
} else {
+ result = FAILURE;
if (free_op2.var) {zval_ptr_dtor(&free_op2.var);};
}
if (free_op1.var) {zval_ptr_dtor(&free_op1.var);};
+ ZVAL_BOOL(&EX_T(opline->result.var).tmp_var, result==SUCCESS?1:0);
+
CHECK_EXCEPTION();
ZEND_VM_NEXT_OPCODE();
}
@@ -20531,6 +20596,7 @@ static int ZEND_FASTCALL ZEND_UNSET_OBJ_SPEC_VAR_VAR_HANDLER(ZEND_OPCODE_HANDLE
zend_free_op free_op1, free_op2;
zval **container;
zval *offset;
+ int result = FAILURE;
SAVE_OPLINE();
container = _get_zval_ptr_ptr_var(opline->op1.var, execute_data, &free_op1 TSRMLS_CC);
@@ -20545,8 +20611,9 @@ static int ZEND_FASTCALL ZEND_UNSET_OBJ_SPEC_VAR_VAR_HANDLER(ZEND_OPCODE_HANDLE
MAKE_REAL_ZVAL_PTR(offset);
}
if (Z_OBJ_HT_P(*container)->unset_property) {
- Z_OBJ_HT_P(*container)->unset_property(*container, offset, ((IS_VAR == IS_CONST) ? opline->op2.literal : NULL) TSRMLS_CC);
+ result = Z_OBJ_HT_P(*container)->unset_property(*container, offset, ((IS_VAR == IS_CONST) ? opline->op2.literal : NULL) TSRMLS_CC);
} else {
+ result = FAILURE;
zend_error(E_NOTICE, "Trying to unset property of non-object");
}
if (0) {
@@ -20555,6 +20622,7 @@ static int ZEND_FASTCALL ZEND_UNSET_OBJ_SPEC_VAR_VAR_HANDLER(ZEND_OPCODE_HANDLE
if (free_op2.var) {zval_ptr_dtor(&free_op2.var);};
}
} else {
+ result = FAILURE;
if (free_op2.var) {zval_ptr_dtor(&free_op2.var);};
}
} else {
@@ -20562,6 +20630,8 @@ static int ZEND_FASTCALL ZEND_UNSET_OBJ_SPEC_VAR_VAR_HANDLER(ZEND_OPCODE_HANDLE
}
if (free_op1.var) {zval_ptr_dtor(&free_op1.var);};
+ ZVAL_BOOL(&EX_T(opline->result.var).tmp_var, result==SUCCESS?1:0);
+
CHECK_EXCEPTION();
ZEND_VM_NEXT_OPCODE();
}
@@ -21774,6 +21844,7 @@ static int ZEND_FASTCALL ZEND_UNSET_VAR_SPEC_VAR_UNUSED_HANDLER(ZEND_OPCODE_HAN
zval tmp, *varname;
HashTable *target_symbol_table;
zend_free_op free_op1;
+ int result = FAILURE;
SAVE_OPLINE();
if (IS_VAR == IS_CV &&
@@ -21782,12 +21853,14 @@ static int ZEND_FASTCALL ZEND_UNSET_VAR_SPEC_VAR_UNUSED_HANDLER(ZEND_OPCODE_HAN
if (EG(active_symbol_table)) {
zend_compiled_variable *cv = &CV_DEF_OF(opline->op1.var);
- zend_delete_variable(EX(prev_execute_data), EG(active_symbol_table), cv->name, cv->name_len+1, cv->hash_value TSRMLS_CC);
+ result = zend_delete_variable(EX(prev_execute_data), EG(active_symbol_table), cv->name, cv->name_len+1, cv->hash_value TSRMLS_CC);
EX_CV(opline->op1.var) = NULL;
} else if (EX_CV(opline->op1.var)) {
zval_ptr_dtor(EX_CV(opline->op1.var));
+ result = SUCCESS;
EX_CV(opline->op1.var) = NULL;
}
+ ZVAL_BOOL(&EX_T(opline->result.var).tmp_var, result==SUCCESS?1:0);
CHECK_EXCEPTION();
ZEND_VM_NEXT_OPCODE();
}
@@ -21817,6 +21890,7 @@ static int ZEND_FASTCALL ZEND_UNSET_VAR_SPEC_VAR_UNUSED_HANDLER(ZEND_OPCODE_HAN
} else if (IS_VAR == IS_VAR || IS_VAR == IS_CV) {
zval_ptr_dtor(&varname);
}
+ ZVAL_BOOL(&EX_T(opline->result.var).tmp_var, 0);
if (free_op1.var) {zval_ptr_dtor(&free_op1.var);};
CHECK_EXCEPTION();
ZEND_VM_NEXT_OPCODE();
@@ -21826,13 +21900,14 @@ static int ZEND_FASTCALL ZEND_UNSET_VAR_SPEC_VAR_UNUSED_HANDLER(ZEND_OPCODE_HAN
} else {
ce = EX_T(opline->op2.var).class_entry;
}
- zend_std_unset_static_property(ce, Z_STRVAL_P(varname), Z_STRLEN_P(varname), ((IS_VAR == IS_CONST) ? opline->op1.literal : NULL) TSRMLS_CC);
+ result = zend_std_unset_static_property(ce, Z_STRVAL_P(varname), Z_STRLEN_P(varname), ((IS_VAR == IS_CONST) ? opline->op1.literal : NULL) TSRMLS_CC);
} else {
ulong hash_value = zend_inline_hash_func(varname->value.str.val, varname->value.str.len+1);
target_symbol_table = zend_get_target_symbol_table(opline->extended_value & ZEND_FETCH_TYPE_MASK TSRMLS_CC);
- zend_delete_variable(execute_data, target_symbol_table, varname->value.str.val, varname->value.str.len+1, hash_value TSRMLS_CC);
+ result = zend_delete_variable(execute_data, target_symbol_table, varname->value.str.val, varname->value.str.len+1, hash_value TSRMLS_CC);
}
+ ZVAL_BOOL(&EX_T(opline->result.var).tmp_var, result==SUCCESS?1:0);
if (IS_VAR != IS_CONST && varname == &tmp) {
zval_dtor(&tmp);
@@ -23808,6 +23883,7 @@ static int ZEND_FASTCALL ZEND_UNSET_DIM_SPEC_VAR_CV_HANDLER(ZEND_OPCODE_HANDLER
zval **container;
zval *offset;
ulong hval;
+ int result = FAILURE;
SAVE_OPLINE();
container = _get_zval_ptr_ptr_var(opline->op1.var, execute_data, &free_op1 TSRMLS_CC);
@@ -23824,13 +23900,13 @@ static int ZEND_FASTCALL ZEND_UNSET_DIM_SPEC_VAR_CV_HANDLER(ZEND_OPCODE_HANDLER
switch (Z_TYPE_P(offset)) {
case IS_DOUBLE:
hval = zend_dval_to_lval(Z_DVAL_P(offset));
- zend_hash_index_del(ht, hval);
+ result = zend_hash_index_del(ht, hval);
break;
case IS_RESOURCE:
case IS_BOOL:
case IS_LONG:
hval = Z_LVAL_P(offset);
- zend_hash_index_del(ht, hval);
+ result = zend_hash_index_del(ht, hval);
break;
case IS_STRING:
if (IS_CV == IS_CV || IS_CV == IS_VAR) {
@@ -23847,22 +23923,22 @@ static int ZEND_FASTCALL ZEND_UNSET_DIM_SPEC_VAR_CV_HANDLER(ZEND_OPCODE_HANDLER
}
}
if (ht == &EG(symbol_table)) {
- zend_delete_global_variable_ex(offset->value.str.val, offset->value.str.len, hval TSRMLS_CC);
+ result = zend_delete_global_variable_ex(offset->value.str.val, offset->value.str.len, hval TSRMLS_CC);
} else {
- zend_hash_quick_del(ht, Z_STRVAL_P(offset), Z_STRLEN_P(offset)+1, hval);
+ result = zend_hash_quick_del(ht, Z_STRVAL_P(offset), Z_STRLEN_P(offset)+1, hval);
}
if (IS_CV == IS_CV || IS_CV == IS_VAR) {
zval_ptr_dtor(&offset);
}
break;
num_index_dim:
- zend_hash_index_del(ht, hval);
+ result = zend_hash_index_del(ht, hval);
if (IS_CV == IS_CV || IS_CV == IS_VAR) {
zval_ptr_dtor(&offset);
}
break;
case IS_NULL:
- zend_hash_del(ht, "", sizeof(""));
+ result = zend_hash_del(ht, "", sizeof(""));
break;
default:
zend_error(E_WARNING, "Illegal offset type in unset");
@@ -23878,8 +23954,8 @@ static int ZEND_FASTCALL ZEND_UNSET_DIM_SPEC_VAR_CV_HANDLER(ZEND_OPCODE_HANDLER
if (0) {
MAKE_REAL_ZVAL_PTR(offset);
}
- Z_OBJ_HT_P(*container)->unset_dimension(*container, offset TSRMLS_CC);
- if (0) {
+ result = Z_OBJ_HT_P(*container)->unset_dimension(*container, offset TSRMLS_CC);
+ if ((result = 0?SUCCESS:FAILURE) == SUCCESS) {
zval_ptr_dtor(&offset);
} else {
@@ -23889,14 +23965,18 @@ static int ZEND_FASTCALL ZEND_UNSET_DIM_SPEC_VAR_CV_HANDLER(ZEND_OPCODE_HANDLER
zend_error_noreturn(E_ERROR, "Cannot unset string offsets");
ZEND_VM_CONTINUE(); /* bailed out before */
default:
+ result = FAILURE;
break;
}
} else {
+ result = FAILURE;
}
if (free_op1.var) {zval_ptr_dtor(&free_op1.var);};
+ ZVAL_BOOL(&EX_T(opline->result.var).tmp_var, result==SUCCESS?1:0);
+
CHECK_EXCEPTION();
ZEND_VM_NEXT_OPCODE();
}
@@ -23907,6 +23987,7 @@ static int ZEND_FASTCALL ZEND_UNSET_OBJ_SPEC_VAR_CV_HANDLER(ZEND_OPCODE_HANDLER
zend_free_op free_op1;
zval **container;
zval *offset;
+ int result = FAILURE;
SAVE_OPLINE();
container = _get_zval_ptr_ptr_var(opline->op1.var, execute_data, &free_op1 TSRMLS_CC);
@@ -23921,8 +24002,9 @@ static int ZEND_FASTCALL ZEND_UNSET_OBJ_SPEC_VAR_CV_HANDLER(ZEND_OPCODE_HANDLER
MAKE_REAL_ZVAL_PTR(offset);
}
if (Z_OBJ_HT_P(*container)->unset_property) {
- Z_OBJ_HT_P(*container)->unset_property(*container, offset, ((IS_CV == IS_CONST) ? opline->op2.literal : NULL) TSRMLS_CC);
+ result = Z_OBJ_HT_P(*container)->unset_property(*container, offset, ((IS_CV == IS_CONST) ? opline->op2.literal : NULL) TSRMLS_CC);
} else {
+ result = FAILURE;
zend_error(E_NOTICE, "Trying to unset property of non-object");
}
if (0) {
@@ -23931,6 +24013,7 @@ static int ZEND_FASTCALL ZEND_UNSET_OBJ_SPEC_VAR_CV_HANDLER(ZEND_OPCODE_HANDLER
}
} else {
+ result = FAILURE;
}
} else {
@@ -23938,6 +24021,8 @@ static int ZEND_FASTCALL ZEND_UNSET_OBJ_SPEC_VAR_CV_HANDLER(ZEND_OPCODE_HANDLER
}
if (free_op1.var) {zval_ptr_dtor(&free_op1.var);};
+ ZVAL_BOOL(&EX_T(opline->result.var).tmp_var, result==SUCCESS?1:0);
+
CHECK_EXCEPTION();
ZEND_VM_NEXT_OPCODE();
}
@@ -25317,6 +25402,7 @@ static int ZEND_FASTCALL ZEND_UNSET_DIM_SPEC_UNUSED_CONST_HANDLER(ZEND_OPCODE_H
zval **container;
zval *offset;
ulong hval;
+ int result = FAILURE;
SAVE_OPLINE();
container = _get_obj_zval_ptr_ptr_unused(TSRMLS_C);
@@ -25333,13 +25419,13 @@ static int ZEND_FASTCALL ZEND_UNSET_DIM_SPEC_UNUSED_CONST_HANDLER(ZEND_OPCODE_H
switch (Z_TYPE_P(offset)) {
case IS_DOUBLE:
hval = zend_dval_to_lval(Z_DVAL_P(offset));
- zend_hash_index_del(ht, hval);
+ result = zend_hash_index_del(ht, hval);
break;
case IS_RESOURCE:
case IS_BOOL:
case IS_LONG:
hval = Z_LVAL_P(offset);
- zend_hash_index_del(ht, hval);
+ result = zend_hash_index_del(ht, hval);
break;
case IS_STRING:
if (IS_CONST == IS_CV || IS_CONST == IS_VAR) {
@@ -25356,22 +25442,22 @@ static int ZEND_FASTCALL ZEND_UNSET_DIM_SPEC_UNUSED_CONST_HANDLER(ZEND_OPCODE_H
}
}
if (ht == &EG(symbol_table)) {
- zend_delete_global_variable_ex(offset->value.str.val, offset->value.str.len, hval TSRMLS_CC);
+ result = zend_delete_global_variable_ex(offset->value.str.val, offset->value.str.len, hval TSRMLS_CC);
} else {
- zend_hash_quick_del(ht, Z_STRVAL_P(offset), Z_STRLEN_P(offset)+1, hval);
+ result = zend_hash_quick_del(ht, Z_STRVAL_P(offset), Z_STRLEN_P(offset)+1, hval);
}
if (IS_CONST == IS_CV || IS_CONST == IS_VAR) {
zval_ptr_dtor(&offset);
}
break;
num_index_dim:
- zend_hash_index_del(ht, hval);
+ result = zend_hash_index_del(ht, hval);
if (IS_CONST == IS_CV || IS_CONST == IS_VAR) {
zval_ptr_dtor(&offset);
}
break;
case IS_NULL:
- zend_hash_del(ht, "", sizeof(""));
+ result = zend_hash_del(ht, "", sizeof(""));
break;
default:
zend_error(E_WARNING, "Illegal offset type in unset");
@@ -25387,8 +25473,8 @@ static int ZEND_FASTCALL ZEND_UNSET_DIM_SPEC_UNUSED_CONST_HANDLER(ZEND_OPCODE_H
if (0) {
MAKE_REAL_ZVAL_PTR(offset);
}
- Z_OBJ_HT_P(*container)->unset_dimension(*container, offset TSRMLS_CC);
- if (0) {
+ result = Z_OBJ_HT_P(*container)->unset_dimension(*container, offset TSRMLS_CC);
+ if ((result = 0?SUCCESS:FAILURE) == SUCCESS) {
zval_ptr_dtor(&offset);
} else {
@@ -25398,13 +25484,17 @@ static int ZEND_FASTCALL ZEND_UNSET_DIM_SPEC_UNUSED_CONST_HANDLER(ZEND_OPCODE_H
zend_error_noreturn(E_ERROR, "Cannot unset string offsets");
ZEND_VM_CONTINUE(); /* bailed out before */
default:
+ result = FAILURE;
break;
}
} else {
+ result = FAILURE;
}
+ ZVAL_BOOL(&EX_T(opline->result.var).tmp_var, result==SUCCESS?1:0);
+
CHECK_EXCEPTION();
ZEND_VM_NEXT_OPCODE();
}
@@ -25415,6 +25505,7 @@ static int ZEND_FASTCALL ZEND_UNSET_OBJ_SPEC_UNUSED_CONST_HANDLER(ZEND_OPCODE_H
zval **container;
zval *offset;
+ int result = FAILURE;
SAVE_OPLINE();
container = _get_obj_zval_ptr_ptr_unused(TSRMLS_C);
@@ -25429,8 +25520,9 @@ static int ZEND_FASTCALL ZEND_UNSET_OBJ_SPEC_UNUSED_CONST_HANDLER(ZEND_OPCODE_H
MAKE_REAL_ZVAL_PTR(offset);
}
if (Z_OBJ_HT_P(*container)->unset_property) {
- Z_OBJ_HT_P(*container)->unset_property(*container, offset, ((IS_CONST == IS_CONST) ? opline->op2.literal : NULL) TSRMLS_CC);
+ result = Z_OBJ_HT_P(*container)->unset_property(*container, offset, ((IS_CONST == IS_CONST) ? opline->op2.literal : NULL) TSRMLS_CC);
} else {
+ result = FAILURE;
zend_error(E_NOTICE, "Trying to unset property of non-object");
}
if (0) {
@@ -25439,12 +25531,15 @@ static int ZEND_FASTCALL ZEND_UNSET_OBJ_SPEC_UNUSED_CONST_HANDLER(ZEND_OPCODE_H
}
} else {
+ result = FAILURE;
}
} else {
}
+ ZVAL_BOOL(&EX_T(opline->result.var).tmp_var, result==SUCCESS?1:0);
+
CHECK_EXCEPTION();
ZEND_VM_NEXT_OPCODE();
}
@@ -26638,6 +26733,7 @@ static int ZEND_FASTCALL ZEND_UNSET_DIM_SPEC_UNUSED_TMP_HANDLER(ZEND_OPCODE_HAN
zval **container;
zval *offset;
ulong hval;
+ int result = FAILURE;
SAVE_OPLINE();
container = _get_obj_zval_ptr_ptr_unused(TSRMLS_C);
@@ -26654,13 +26750,13 @@ static int ZEND_FASTCALL ZEND_UNSET_DIM_SPEC_UNUSED_TMP_HANDLER(ZEND_OPCODE_HAN
switch (Z_TYPE_P(offset)) {
case IS_DOUBLE:
hval = zend_dval_to_lval(Z_DVAL_P(offset));
- zend_hash_index_del(ht, hval);
+ result = zend_hash_index_del(ht, hval);
break;
case IS_RESOURCE:
case IS_BOOL:
case IS_LONG:
hval = Z_LVAL_P(offset);
- zend_hash_index_del(ht, hval);
+ result = zend_hash_index_del(ht, hval);
break;
case IS_STRING:
if (IS_TMP_VAR == IS_CV || IS_TMP_VAR == IS_VAR) {
@@ -26677,22 +26773,22 @@ static int ZEND_FASTCALL ZEND_UNSET_DIM_SPEC_UNUSED_TMP_HANDLER(ZEND_OPCODE_HAN
}
}
if (ht == &EG(symbol_table)) {
- zend_delete_global_variable_ex(offset->value.str.val, offset->value.str.len, hval TSRMLS_CC);
+ result = zend_delete_global_variable_ex(offset->value.str.val, offset->value.str.len, hval TSRMLS_CC);
} else {
- zend_hash_quick_del(ht, Z_STRVAL_P(offset), Z_STRLEN_P(offset)+1, hval);
+ result = zend_hash_quick_del(ht, Z_STRVAL_P(offset), Z_STRLEN_P(offset)+1, hval);
}
if (IS_TMP_VAR == IS_CV || IS_TMP_VAR == IS_VAR) {
zval_ptr_dtor(&offset);
}
break;
num_index_dim:
- zend_hash_index_del(ht, hval);
+ result = zend_hash_index_del(ht, hval);
if (IS_TMP_VAR == IS_CV || IS_TMP_VAR == IS_VAR) {
zval_ptr_dtor(&offset);
}
break;
case IS_NULL:
- zend_hash_del(ht, "", sizeof(""));
+ result = zend_hash_del(ht, "", sizeof(""));
break;
default:
zend_error(E_WARNING, "Illegal offset type in unset");
@@ -26708,8 +26804,8 @@ static int ZEND_FASTCALL ZEND_UNSET_DIM_SPEC_UNUSED_TMP_HANDLER(ZEND_OPCODE_HAN
if (1) {
MAKE_REAL_ZVAL_PTR(offset);
}
- Z_OBJ_HT_P(*container)->unset_dimension(*container, offset TSRMLS_CC);
- if (1) {
+ result = Z_OBJ_HT_P(*container)->unset_dimension(*container, offset TSRMLS_CC);
+ if ((result = 1?SUCCESS:FAILURE) == SUCCESS) {
zval_ptr_dtor(&offset);
} else {
zval_dtor(free_op2.var);
@@ -26719,13 +26815,17 @@ static int ZEND_FASTCALL ZEND_UNSET_DIM_SPEC_UNUSED_TMP_HANDLER(ZEND_OPCODE_HAN
zend_error_noreturn(E_ERROR, "Cannot unset string offsets");
ZEND_VM_CONTINUE(); /* bailed out before */
default:
+ result = FAILURE;
zval_dtor(free_op2.var);
break;
}
} else {
+ result = FAILURE;
zval_dtor(free_op2.var);
}
+ ZVAL_BOOL(&EX_T(opline->result.var).tmp_var, result==SUCCESS?1:0);
+
CHECK_EXCEPTION();
ZEND_VM_NEXT_OPCODE();
}
@@ -26736,6 +26836,7 @@ static int ZEND_FASTCALL ZEND_UNSET_OBJ_SPEC_UNUSED_TMP_HANDLER(ZEND_OPCODE_HAN
zend_free_op free_op2;
zval **container;
zval *offset;
+ int result = FAILURE;
SAVE_OPLINE();
container = _get_obj_zval_ptr_ptr_unused(TSRMLS_C);
@@ -26750,8 +26851,9 @@ static int ZEND_FASTCALL ZEND_UNSET_OBJ_SPEC_UNUSED_TMP_HANDLER(ZEND_OPCODE_HAN
MAKE_REAL_ZVAL_PTR(offset);
}
if (Z_OBJ_HT_P(*container)->unset_property) {
- Z_OBJ_HT_P(*container)->unset_property(*container, offset, ((IS_TMP_VAR == IS_CONST) ? opline->op2.literal : NULL) TSRMLS_CC);
+ result = Z_OBJ_HT_P(*container)->unset_property(*container, offset, ((IS_TMP_VAR == IS_CONST) ? opline->op2.literal : NULL) TSRMLS_CC);
} else {
+ result = FAILURE;
zend_error(E_NOTICE, "Trying to unset property of non-object");
}
if (1) {
@@ -26760,12 +26862,15 @@ static int ZEND_FASTCALL ZEND_UNSET_OBJ_SPEC_UNUSED_TMP_HANDLER(ZEND_OPCODE_HAN
zval_dtor(free_op2.var);
}
} else {
+ result = FAILURE;
zval_dtor(free_op2.var);
}
} else {
zval_dtor(free_op2.var);
}
+ ZVAL_BOOL(&EX_T(opline->result.var).tmp_var, result==SUCCESS?1:0);
+
CHECK_EXCEPTION();
ZEND_VM_NEXT_OPCODE();
}
@@ -27959,6 +28064,7 @@ static int ZEND_FASTCALL ZEND_UNSET_DIM_SPEC_UNUSED_VAR_HANDLER(ZEND_OPCODE_HAN
zval **container;
zval *offset;
ulong hval;
+ int result = FAILURE;
SAVE_OPLINE();
container = _get_obj_zval_ptr_ptr_unused(TSRMLS_C);
@@ -27975,13 +28081,13 @@ static int ZEND_FASTCALL ZEND_UNSET_DIM_SPEC_UNUSED_VAR_HANDLER(ZEND_OPCODE_HAN
switch (Z_TYPE_P(offset)) {
case IS_DOUBLE:
hval = zend_dval_to_lval(Z_DVAL_P(offset));
- zend_hash_index_del(ht, hval);
+ result = zend_hash_index_del(ht, hval);
break;
case IS_RESOURCE:
case IS_BOOL:
case IS_LONG:
hval = Z_LVAL_P(offset);
- zend_hash_index_del(ht, hval);
+ result = zend_hash_index_del(ht, hval);
break;
case IS_STRING:
if (IS_VAR == IS_CV || IS_VAR == IS_VAR) {
@@ -27998,22 +28104,22 @@ static int ZEND_FASTCALL ZEND_UNSET_DIM_SPEC_UNUSED_VAR_HANDLER(ZEND_OPCODE_HAN
}
}
if (ht == &EG(symbol_table)) {
- zend_delete_global_variable_ex(offset->value.str.val, offset->value.str.len, hval TSRMLS_CC);
+ result = zend_delete_global_variable_ex(offset->value.str.val, offset->value.str.len, hval TSRMLS_CC);
} else {
- zend_hash_quick_del(ht, Z_STRVAL_P(offset), Z_STRLEN_P(offset)+1, hval);
+ result = zend_hash_quick_del(ht, Z_STRVAL_P(offset), Z_STRLEN_P(offset)+1, hval);
}
if (IS_VAR == IS_CV || IS_VAR == IS_VAR) {
zval_ptr_dtor(&offset);
}
break;
num_index_dim:
- zend_hash_index_del(ht, hval);
+ result = zend_hash_index_del(ht, hval);
if (IS_VAR == IS_CV || IS_VAR == IS_VAR) {
zval_ptr_dtor(&offset);
}
break;
case IS_NULL:
- zend_hash_del(ht, "", sizeof(""));
+ result = zend_hash_del(ht, "", sizeof(""));
break;
default:
zend_error(E_WARNING, "Illegal offset type in unset");
@@ -28029,8 +28135,8 @@ static int ZEND_FASTCALL ZEND_UNSET_DIM_SPEC_UNUSED_VAR_HANDLER(ZEND_OPCODE_HAN
if (0) {
MAKE_REAL_ZVAL_PTR(offset);
}
- Z_OBJ_HT_P(*container)->unset_dimension(*container, offset TSRMLS_CC);
- if (0) {
+ result = Z_OBJ_HT_P(*container)->unset_dimension(*container, offset TSRMLS_CC);
+ if ((result = 0?SUCCESS:FAILURE) == SUCCESS) {
zval_ptr_dtor(&offset);
} else {
if (free_op2.var) {zval_ptr_dtor(&free_op2.var);};
@@ -28040,13 +28146,17 @@ static int ZEND_FASTCALL ZEND_UNSET_DIM_SPEC_UNUSED_VAR_HANDLER(ZEND_OPCODE_HAN
zend_error_noreturn(E_ERROR, "Cannot unset string offsets");
ZEND_VM_CONTINUE(); /* bailed out before */
default:
+ result = FAILURE;
if (free_op2.var) {zval_ptr_dtor(&free_op2.var);};
break;
}
} else {
+ result = FAILURE;
if (free_op2.var) {zval_ptr_dtor(&free_op2.var);};
}
+ ZVAL_BOOL(&EX_T(opline->result.var).tmp_var, result==SUCCESS?1:0);
+
CHECK_EXCEPTION();
ZEND_VM_NEXT_OPCODE();
}
@@ -28057,6 +28167,7 @@ static int ZEND_FASTCALL ZEND_UNSET_OBJ_SPEC_UNUSED_VAR_HANDLER(ZEND_OPCODE_HAN
zend_free_op free_op2;
zval **container;
zval *offset;
+ int result = FAILURE;
SAVE_OPLINE();
container = _get_obj_zval_ptr_ptr_unused(TSRMLS_C);
@@ -28071,8 +28182,9 @@ static int ZEND_FASTCALL ZEND_UNSET_OBJ_SPEC_UNUSED_VAR_HANDLER(ZEND_OPCODE_HAN
MAKE_REAL_ZVAL_PTR(offset);
}
if (Z_OBJ_HT_P(*container)->unset_property) {
- Z_OBJ_HT_P(*container)->unset_property(*container, offset, ((IS_VAR == IS_CONST) ? opline->op2.literal : NULL) TSRMLS_CC);
+ result = Z_OBJ_HT_P(*container)->unset_property(*container, offset, ((IS_VAR == IS_CONST) ? opline->op2.literal : NULL) TSRMLS_CC);
} else {
+ result = FAILURE;
zend_error(E_NOTICE, "Trying to unset property of non-object");
}
if (0) {
@@ -28081,12 +28193,15 @@ static int ZEND_FASTCALL ZEND_UNSET_OBJ_SPEC_UNUSED_VAR_HANDLER(ZEND_OPCODE_HAN
if (free_op2.var) {zval_ptr_dtor(&free_op2.var);};
}
} else {
+ result = FAILURE;
if (free_op2.var) {zval_ptr_dtor(&free_op2.var);};
}
} else {
if (free_op2.var) {zval_ptr_dtor(&free_op2.var);};
}
+ ZVAL_BOOL(&EX_T(opline->result.var).tmp_var, result==SUCCESS?1:0);
+
CHECK_EXCEPTION();
ZEND_VM_NEXT_OPCODE();
}
@@ -29700,6 +29815,7 @@ static int ZEND_FASTCALL ZEND_UNSET_DIM_SPEC_UNUSED_CV_HANDLER(ZEND_OPCODE_HAND
zval **container;
zval *offset;
ulong hval;
+ int result = FAILURE;
SAVE_OPLINE();
container = _get_obj_zval_ptr_ptr_unused(TSRMLS_C);
@@ -29716,13 +29832,13 @@ static int ZEND_FASTCALL ZEND_UNSET_DIM_SPEC_UNUSED_CV_HANDLER(ZEND_OPCODE_HAND
switch (Z_TYPE_P(offset)) {
case IS_DOUBLE:
hval = zend_dval_to_lval(Z_DVAL_P(offset));
- zend_hash_index_del(ht, hval);
+ result = zend_hash_index_del(ht, hval);
break;
case IS_RESOURCE:
case IS_BOOL:
case IS_LONG:
hval = Z_LVAL_P(offset);
- zend_hash_index_del(ht, hval);
+ result = zend_hash_index_del(ht, hval);
break;
case IS_STRING:
if (IS_CV == IS_CV || IS_CV == IS_VAR) {
@@ -29739,22 +29855,22 @@ static int ZEND_FASTCALL ZEND_UNSET_DIM_SPEC_UNUSED_CV_HANDLER(ZEND_OPCODE_HAND
}
}
if (ht == &EG(symbol_table)) {
- zend_delete_global_variable_ex(offset->value.str.val, offset->value.str.len, hval TSRMLS_CC);
+ result = zend_delete_global_variable_ex(offset->value.str.val, offset->value.str.len, hval TSRMLS_CC);
} else {
- zend_hash_quick_del(ht, Z_STRVAL_P(offset), Z_STRLEN_P(offset)+1, hval);
+ result = zend_hash_quick_del(ht, Z_STRVAL_P(offset), Z_STRLEN_P(offset)+1, hval);
}
if (IS_CV == IS_CV || IS_CV == IS_VAR) {
zval_ptr_dtor(&offset);
}
break;
num_index_dim:
- zend_hash_index_del(ht, hval);
+ result = zend_hash_index_del(ht, hval);
if (IS_CV == IS_CV || IS_CV == IS_VAR) {
zval_ptr_dtor(&offset);
}
break;
case IS_NULL:
- zend_hash_del(ht, "", sizeof(""));
+ result = zend_hash_del(ht, "", sizeof(""));
break;
default:
zend_error(E_WARNING, "Illegal offset type in unset");
@@ -29770,8 +29886,8 @@ static int ZEND_FASTCALL ZEND_UNSET_DIM_SPEC_UNUSED_CV_HANDLER(ZEND_OPCODE_HAND
if (0) {
MAKE_REAL_ZVAL_PTR(offset);
}
- Z_OBJ_HT_P(*container)->unset_dimension(*container, offset TSRMLS_CC);
- if (0) {
+ result = Z_OBJ_HT_P(*container)->unset_dimension(*container, offset TSRMLS_CC);
+ if ((result = 0?SUCCESS:FAILURE) == SUCCESS) {
zval_ptr_dtor(&offset);
} else {
@@ -29781,13 +29897,17 @@ static int ZEND_FASTCALL ZEND_UNSET_DIM_SPEC_UNUSED_CV_HANDLER(ZEND_OPCODE_HAND
zend_error_noreturn(E_ERROR, "Cannot unset string offsets");
ZEND_VM_CONTINUE(); /* bailed out before */
default:
+ result = FAILURE;
break;
}
} else {
+ result = FAILURE;
}
+ ZVAL_BOOL(&EX_T(opline->result.var).tmp_var, result==SUCCESS?1:0);
+
CHECK_EXCEPTION();
ZEND_VM_NEXT_OPCODE();
}
@@ -29798,6 +29918,7 @@ static int ZEND_FASTCALL ZEND_UNSET_OBJ_SPEC_UNUSED_CV_HANDLER(ZEND_OPCODE_HAND
zval **container;
zval *offset;
+ int result = FAILURE;
SAVE_OPLINE();
container = _get_obj_zval_ptr_ptr_unused(TSRMLS_C);
@@ -29812,8 +29933,9 @@ static int ZEND_FASTCALL ZEND_UNSET_OBJ_SPEC_UNUSED_CV_HANDLER(ZEND_OPCODE_HAND
MAKE_REAL_ZVAL_PTR(offset);
}
if (Z_OBJ_HT_P(*container)->unset_property) {
- Z_OBJ_HT_P(*container)->unset_property(*container, offset, ((IS_CV == IS_CONST) ? opline->op2.literal : NULL) TSRMLS_CC);
+ result = Z_OBJ_HT_P(*container)->unset_property(*container, offset, ((IS_CV == IS_CONST) ? opline->op2.literal : NULL) TSRMLS_CC);
} else {
+ result = FAILURE;
zend_error(E_NOTICE, "Trying to unset property of non-object");
}
if (0) {
@@ -29822,12 +29944,15 @@ static int ZEND_FASTCALL ZEND_UNSET_OBJ_SPEC_UNUSED_CV_HANDLER(ZEND_OPCODE_HAND
}
} else {
+ result = FAILURE;
}
} else {
}
+ ZVAL_BOOL(&EX_T(opline->result.var).tmp_var, result==SUCCESS?1:0);
+
CHECK_EXCEPTION();
ZEND_VM_NEXT_OPCODE();
}
@@ -33044,6 +33169,7 @@ static int ZEND_FASTCALL ZEND_UNSET_VAR_SPEC_CV_CONST_HANDLER(ZEND_OPCODE_HANDL
zval tmp, *varname;
HashTable *target_symbol_table;
+ int result = FAILURE;
SAVE_OPLINE();
if (IS_CV == IS_CV &&
@@ -33052,12 +33178,14 @@ static int ZEND_FASTCALL ZEND_UNSET_VAR_SPEC_CV_CONST_HANDLER(ZEND_OPCODE_HANDL
if (EG(active_symbol_table)) {
zend_compiled_variable *cv = &CV_DEF_OF(opline->op1.var);
- zend_delete_variable(EX(prev_execute_data), EG(active_symbol_table), cv->name, cv->name_len+1, cv->hash_value TSRMLS_CC);
+ result = zend_delete_variable(EX(prev_execute_data), EG(active_symbol_table), cv->name, cv->name_len+1, cv->hash_value TSRMLS_CC);
EX_CV(opline->op1.var) = NULL;
} else if (EX_CV(opline->op1.var)) {
zval_ptr_dtor(EX_CV(opline->op1.var));
+ result = SUCCESS;
EX_CV(opline->op1.var) = NULL;
}
+ ZVAL_BOOL(&EX_T(opline->result.var).tmp_var, result==SUCCESS?1:0);
CHECK_EXCEPTION();
ZEND_VM_NEXT_OPCODE();
}
@@ -33087,6 +33215,7 @@ static int ZEND_FASTCALL ZEND_UNSET_VAR_SPEC_CV_CONST_HANDLER(ZEND_OPCODE_HANDL
} else if (IS_CV == IS_VAR || IS_CV == IS_CV) {
zval_ptr_dtor(&varname);
}
+ ZVAL_BOOL(&EX_T(opline->result.var).tmp_var, 0);
CHECK_EXCEPTION();
ZEND_VM_NEXT_OPCODE();
@@ -33096,13 +33225,14 @@ static int ZEND_FASTCALL ZEND_UNSET_VAR_SPEC_CV_CONST_HANDLER(ZEND_OPCODE_HANDL
} else {
ce = EX_T(opline->op2.var).class_entry;
}
- zend_std_unset_static_property(ce, Z_STRVAL_P(varname), Z_STRLEN_P(varname), ((IS_CV == IS_CONST) ? opline->op1.literal : NULL) TSRMLS_CC);
+ result = zend_std_unset_static_property(ce, Z_STRVAL_P(varname), Z_STRLEN_P(varname), ((IS_CV == IS_CONST) ? opline->op1.literal : NULL) TSRMLS_CC);
} else {
ulong hash_value = zend_inline_hash_func(varname->value.str.val, varname->value.str.len+1);
target_symbol_table = zend_get_target_symbol_table(opline->extended_value & ZEND_FETCH_TYPE_MASK TSRMLS_CC);
- zend_delete_variable(execute_data, target_symbol_table, varname->value.str.val, varname->value.str.len+1, hash_value TSRMLS_CC);
+ result = zend_delete_variable(execute_data, target_symbol_table, varname->value.str.val, varname->value.str.len+1, hash_value TSRMLS_CC);
}
+ ZVAL_BOOL(&EX_T(opline->result.var).tmp_var, result==SUCCESS?1:0);
if (IS_CV != IS_CONST && varname == &tmp) {
zval_dtor(&tmp);
@@ -33121,6 +33251,7 @@ static int ZEND_FASTCALL ZEND_UNSET_DIM_SPEC_CV_CONST_HANDLER(ZEND_OPCODE_HANDL
zval **container;
zval *offset;
ulong hval;
+ int result = FAILURE;
SAVE_OPLINE();
container = _get_zval_ptr_ptr_cv_BP_VAR_UNSET(execute_data, opline->op1.var TSRMLS_CC);
@@ -33137,13 +33268,13 @@ static int ZEND_FASTCALL ZEND_UNSET_DIM_SPEC_CV_CONST_HANDLER(ZEND_OPCODE_HANDL
switch (Z_TYPE_P(offset)) {
case IS_DOUBLE:
hval = zend_dval_to_lval(Z_DVAL_P(offset));
- zend_hash_index_del(ht, hval);
+ result = zend_hash_index_del(ht, hval);
break;
case IS_RESOURCE:
case IS_BOOL:
case IS_LONG:
hval = Z_LVAL_P(offset);
- zend_hash_index_del(ht, hval);
+ result = zend_hash_index_del(ht, hval);
break;
case IS_STRING:
if (IS_CONST == IS_CV || IS_CONST == IS_VAR) {
@@ -33160,22 +33291,22 @@ static int ZEND_FASTCALL ZEND_UNSET_DIM_SPEC_CV_CONST_HANDLER(ZEND_OPCODE_HANDL
}
}
if (ht == &EG(symbol_table)) {
- zend_delete_global_variable_ex(offset->value.str.val, offset->value.str.len, hval TSRMLS_CC);
+ result = zend_delete_global_variable_ex(offset->value.str.val, offset->value.str.len, hval TSRMLS_CC);
} else {
- zend_hash_quick_del(ht, Z_STRVAL_P(offset), Z_STRLEN_P(offset)+1, hval);
+ result = zend_hash_quick_del(ht, Z_STRVAL_P(offset), Z_STRLEN_P(offset)+1, hval);
}
if (IS_CONST == IS_CV || IS_CONST == IS_VAR) {
zval_ptr_dtor(&offset);
}
break;
num_index_dim:
- zend_hash_index_del(ht, hval);
+ result = zend_hash_index_del(ht, hval);
if (IS_CONST == IS_CV || IS_CONST == IS_VAR) {
zval_ptr_dtor(&offset);
}
break;
case IS_NULL:
- zend_hash_del(ht, "", sizeof(""));
+ result = zend_hash_del(ht, "", sizeof(""));
break;
default:
zend_error(E_WARNING, "Illegal offset type in unset");
@@ -33191,8 +33322,8 @@ static int ZEND_FASTCALL ZEND_UNSET_DIM_SPEC_CV_CONST_HANDLER(ZEND_OPCODE_HANDL
if (0) {
MAKE_REAL_ZVAL_PTR(offset);
}
- Z_OBJ_HT_P(*container)->unset_dimension(*container, offset TSRMLS_CC);
- if (0) {
+ result = Z_OBJ_HT_P(*container)->unset_dimension(*container, offset TSRMLS_CC);
+ if ((result = 0?SUCCESS:FAILURE) == SUCCESS) {
zval_ptr_dtor(&offset);
} else {
@@ -33202,13 +33333,17 @@ static int ZEND_FASTCALL ZEND_UNSET_DIM_SPEC_CV_CONST_HANDLER(ZEND_OPCODE_HANDL
zend_error_noreturn(E_ERROR, "Cannot unset string offsets");
ZEND_VM_CONTINUE(); /* bailed out before */
default:
+ result = FAILURE;
break;
}
} else {
+ result = FAILURE;
}
+ ZVAL_BOOL(&EX_T(opline->result.var).tmp_var, result==SUCCESS?1:0);
+
CHECK_EXCEPTION();
ZEND_VM_NEXT_OPCODE();
}
@@ -33219,6 +33354,7 @@ static int ZEND_FASTCALL ZEND_UNSET_OBJ_SPEC_CV_CONST_HANDLER(ZEND_OPCODE_HANDL
zval **container;
zval *offset;
+ int result = FAILURE;
SAVE_OPLINE();
container = _get_zval_ptr_ptr_cv_BP_VAR_UNSET(execute_data, opline->op1.var TSRMLS_CC);
@@ -33233,8 +33369,9 @@ static int ZEND_FASTCALL ZEND_UNSET_OBJ_SPEC_CV_CONST_HANDLER(ZEND_OPCODE_HANDL
MAKE_REAL_ZVAL_PTR(offset);
}
if (Z_OBJ_HT_P(*container)->unset_property) {
- Z_OBJ_HT_P(*container)->unset_property(*container, offset, ((IS_CONST == IS_CONST) ? opline->op2.literal : NULL) TSRMLS_CC);
+ result = Z_OBJ_HT_P(*container)->unset_property(*container, offset, ((IS_CONST == IS_CONST) ? opline->op2.literal : NULL) TSRMLS_CC);
} else {
+ result = FAILURE;
zend_error(E_NOTICE, "Trying to unset property of non-object");
}
if (0) {
@@ -33243,12 +33380,15 @@ static int ZEND_FASTCALL ZEND_UNSET_OBJ_SPEC_CV_CONST_HANDLER(ZEND_OPCODE_HANDL
}
} else {
+ result = FAILURE;
}
} else {
}
+ ZVAL_BOOL(&EX_T(opline->result.var).tmp_var, result==SUCCESS?1:0);
+
CHECK_EXCEPTION();
ZEND_VM_NEXT_OPCODE();
}
@@ -35167,6 +35307,7 @@ static int ZEND_FASTCALL ZEND_UNSET_DIM_SPEC_CV_TMP_HANDLER(ZEND_OPCODE_HANDLER
zval **container;
zval *offset;
ulong hval;
+ int result = FAILURE;
SAVE_OPLINE();
container = _get_zval_ptr_ptr_cv_BP_VAR_UNSET(execute_data, opline->op1.var TSRMLS_CC);
@@ -35183,13 +35324,13 @@ static int ZEND_FASTCALL ZEND_UNSET_DIM_SPEC_CV_TMP_HANDLER(ZEND_OPCODE_HANDLER
switch (Z_TYPE_P(offset)) {
case IS_DOUBLE:
hval = zend_dval_to_lval(Z_DVAL_P(offset));
- zend_hash_index_del(ht, hval);
+ result = zend_hash_index_del(ht, hval);
break;
case IS_RESOURCE:
case IS_BOOL:
case IS_LONG:
hval = Z_LVAL_P(offset);
- zend_hash_index_del(ht, hval);
+ result = zend_hash_index_del(ht, hval);
break;
case IS_STRING:
if (IS_TMP_VAR == IS_CV || IS_TMP_VAR == IS_VAR) {
@@ -35206,22 +35347,22 @@ static int ZEND_FASTCALL ZEND_UNSET_DIM_SPEC_CV_TMP_HANDLER(ZEND_OPCODE_HANDLER
}
}
if (ht == &EG(symbol_table)) {
- zend_delete_global_variable_ex(offset->value.str.val, offset->value.str.len, hval TSRMLS_CC);
+ result = zend_delete_global_variable_ex(offset->value.str.val, offset->value.str.len, hval TSRMLS_CC);
} else {
- zend_hash_quick_del(ht, Z_STRVAL_P(offset), Z_STRLEN_P(offset)+1, hval);
+ result = zend_hash_quick_del(ht, Z_STRVAL_P(offset), Z_STRLEN_P(offset)+1, hval);
}
if (IS_TMP_VAR == IS_CV || IS_TMP_VAR == IS_VAR) {
zval_ptr_dtor(&offset);
}
break;
num_index_dim:
- zend_hash_index_del(ht, hval);
+ result = zend_hash_index_del(ht, hval);
if (IS_TMP_VAR == IS_CV || IS_TMP_VAR == IS_VAR) {
zval_ptr_dtor(&offset);
}
break;
case IS_NULL:
- zend_hash_del(ht, "", sizeof(""));
+ result = zend_hash_del(ht, "", sizeof(""));
break;
default:
zend_error(E_WARNING, "Illegal offset type in unset");
@@ -35237,8 +35378,8 @@ static int ZEND_FASTCALL ZEND_UNSET_DIM_SPEC_CV_TMP_HANDLER(ZEND_OPCODE_HANDLER
if (1) {
MAKE_REAL_ZVAL_PTR(offset);
}
- Z_OBJ_HT_P(*container)->unset_dimension(*container, offset TSRMLS_CC);
- if (1) {
+ result = Z_OBJ_HT_P(*container)->unset_dimension(*container, offset TSRMLS_CC);
+ if ((result = 1?SUCCESS:FAILURE) == SUCCESS) {
zval_ptr_dtor(&offset);
} else {
zval_dtor(free_op2.var);
@@ -35248,13 +35389,17 @@ static int ZEND_FASTCALL ZEND_UNSET_DIM_SPEC_CV_TMP_HANDLER(ZEND_OPCODE_HANDLER
zend_error_noreturn(E_ERROR, "Cannot unset string offsets");
ZEND_VM_CONTINUE(); /* bailed out before */
default:
+ result = FAILURE;
zval_dtor(free_op2.var);
break;
}
} else {
+ result = FAILURE;
zval_dtor(free_op2.var);
}
+ ZVAL_BOOL(&EX_T(opline->result.var).tmp_var, result==SUCCESS?1:0);
+
CHECK_EXCEPTION();
ZEND_VM_NEXT_OPCODE();
}
@@ -35265,6 +35410,7 @@ static int ZEND_FASTCALL ZEND_UNSET_OBJ_SPEC_CV_TMP_HANDLER(ZEND_OPCODE_HANDLER
zend_free_op free_op2;