1
0
mirror of https://github.com/php/php-src.git synced 2026-04-10 17:43:13 +02:00

Fix type inference

Fixes oss-fuzz #49423 and #49474
This commit is contained in:
Dmitry Stogov
2022-07-25 15:53:06 +03:00
parent e70d282077
commit d50875c822
2 changed files with 22 additions and 0 deletions

View File

@@ -1942,6 +1942,9 @@ static uint32_t assign_dim_array_result_type(
tmp |= MAY_BE_HASH_ONLY(arr_type) ? MAY_BE_ARRAY_NUMERIC_HASH : MAY_BE_ARRAY_KEY_LONG;
} else {
if (dim_type & (MAY_BE_LONG|MAY_BE_FALSE|MAY_BE_TRUE|MAY_BE_RESOURCE|MAY_BE_DOUBLE)) {
if (arr_type & (MAY_BE_UNDEF|MAY_BE_NULL|MAY_BE_FALSE)) {
tmp |= MAY_BE_ARRAY_PACKED;
}
tmp |= MAY_BE_HASH_ONLY(arr_type) ? MAY_BE_ARRAY_NUMERIC_HASH : MAY_BE_ARRAY_KEY_LONG;
}
if (dim_type & MAY_BE_STRING) {