1
0
mirror of https://github.com/php/php-src.git synced 2026-04-11 01:53:36 +02:00

Add debug assertion on type narrowing

This ensures that this will show up as a fuzzing failure.
This commit is contained in:
Nikita Popov
2022-04-10 10:45:52 +02:00
parent d5c854d89a
commit 8e58828e89

View File

@@ -1862,6 +1862,9 @@ static void emit_type_narrowing_warning(const zend_op_array *op_array, zend_ssa
zend_error_at(
E_WARNING, op_array->filename, lineno,
"Narrowing occurred during type inference of %s. Please file a bug report on https://github.com/php/php-src/issues", def_op_name);
#if ZEND_DEBUG
ZEND_ASSERT(0 && "Narrowing during type inference");
#endif
}
ZEND_API uint32_t ZEND_FASTCALL zend_array_type_info(const zval *zv)