1
0
mirror of https://github.com/php/php-src.git synced 2026-03-29 03:32:20 +02:00

Fixed referencecounter inference rules

This commit is contained in:
Dmitry Stogov
2016-10-11 01:58:30 +03:00
parent a8a308f627
commit fae7d6b9bb
2 changed files with 10 additions and 2 deletions

View File

@@ -358,8 +358,8 @@ static const func_info_t func_infos[] = {
F1("strip_tags", MAY_BE_NULL | MAY_BE_STRING),
F0("similar_text", MAY_BE_NULL | MAY_BE_LONG),
F1("explode", MAY_BE_NULL | MAY_BE_FALSE | MAY_BE_ARRAY | MAY_BE_ARRAY_KEY_LONG | MAY_BE_ARRAY_OF_STRING),
F1("implode", MAY_BE_NULL | MAY_BE_STRING),
F1("join", MAY_BE_NULL | MAY_BE_STRING),
FN("implode", MAY_BE_NULL | MAY_BE_STRING),
FN("join", MAY_BE_NULL | MAY_BE_STRING),
FN("setlocale", MAY_BE_NULL | MAY_BE_FALSE | MAY_BE_STRING),
F1("localeconv", MAY_BE_NULL | MAY_BE_ARRAY | MAY_BE_ARRAY_KEY_STRING | MAY_BE_ARRAY_OF_LONG | MAY_BE_ARRAY_OF_STRING | MAY_BE_ARRAY_OF_ARRAY),
#if HAVE_NL_LANGINFO

View File

@@ -2506,6 +2506,10 @@ static void zend_update_type_info(const zend_op_array *op_array,
(opline->extended_value == IS_ARRAY ||
opline->extended_value == IS_OBJECT)) {
tmp |= MAY_BE_RCN;
} else if ((t1 & MAY_BE_STRING) &&
(opline->op1_type == IS_CV) &&
opline->extended_value == IS_STRING) {
tmp |= MAY_BE_RCN;
}
UPDATE_SSA_TYPE(tmp, ssa_ops[i].op1_def);
COPY_SSA_OBJ_TYPE(ssa_ops[i].op1_use, ssa_ops[i].op1_def);
@@ -2521,6 +2525,10 @@ static void zend_update_type_info(const zend_op_array *op_array,
} else if ((opline->extended_value == IS_ARRAY ||
opline->extended_value == IS_OBJECT) &&
(tmp & (MAY_BE_ARRAY|MAY_BE_OBJECT))) {
tmp |= MAY_BE_RC1 | MAY_BE_RCN;
} else if (opline->extended_value == IS_STRING &&
(t1 & MAY_BE_STRING) &&
(opline->op1_type == IS_CV)) {
tmp |= MAY_BE_RC1 | MAY_BE_RCN;
} else {
tmp |= MAY_BE_RC1;