Skip to content

Commit 8e58828

Browse files
committed
Add debug assertion on type narrowing
This ensures that this will show up as a fuzzing failure.
1 parent d5c854d commit 8e58828

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

Zend/Optimizer/zend_inference.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1862,6 +1862,9 @@ static void emit_type_narrowing_warning(const zend_op_array *op_array, zend_ssa
18621862
zend_error_at(
18631863
E_WARNING, op_array->filename, lineno,
18641864
"Narrowing occurred during type inference of %s. Please file a bug report on https://github.com/php/php-src/issues", def_op_name);
1865+
#if ZEND_DEBUG
1866+
ZEND_ASSERT(0 && "Narrowing during type inference");
1867+
#endif
18651868
}
18661869

18671870
ZEND_API uint32_t ZEND_FASTCALL zend_array_type_info(const zval *zv)

0 commit comments

Comments
 (0)