1
0
mirror of https://github.com/php/php-src.git synced 2026-04-27 01:48:26 +02:00

Fixed referencecounter inference rules

(cherry picked from commit fae7d6b9bb)
This commit is contained in:
Dmitry Stogov
2016-10-11 01:58:30 +03:00
committed by Anatol Belski
parent 5a2dd84314
commit 233992409b
2 changed files with 10 additions and 2 deletions
+2 -2
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
+8
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;