mirror of
https://github.com/php/php-src.git
synced 2025-08-15 21:48:51 +02:00
Merge branch 'PHP-8.4'
* PHP-8.4: Fix failed assertion with throwing __toString in binary const expr
This commit is contained in:
commit
03e2613ddd
2 changed files with 24 additions and 1 deletions
22
Zend/tests/oss_fuzz_434346548.phpt
Normal file
22
Zend/tests/oss_fuzz_434346548.phpt
Normal file
|
@ -0,0 +1,22 @@
|
||||||
|
--TEST--
|
||||||
|
OSS-Fuzz #434346548: Failed assertion with throwing __toString in binary const expr
|
||||||
|
--FILE--
|
||||||
|
<?php
|
||||||
|
|
||||||
|
class Foo {
|
||||||
|
function __toString() {}
|
||||||
|
}
|
||||||
|
|
||||||
|
function test($y = new Foo() < "") {
|
||||||
|
var_dump();
|
||||||
|
}
|
||||||
|
|
||||||
|
try {
|
||||||
|
test();
|
||||||
|
} catch (Error $e) {
|
||||||
|
echo $e->getMessage(), "\n";
|
||||||
|
}
|
||||||
|
|
||||||
|
?>
|
||||||
|
--EXPECT--
|
||||||
|
Foo::__toString(): Return value must be of type string, none returned
|
|
@ -610,9 +610,10 @@ ZEND_API zend_result ZEND_FASTCALL zend_ast_evaluate_inner(
|
||||||
ret = FAILURE;
|
ret = FAILURE;
|
||||||
} else {
|
} else {
|
||||||
binary_op_type op = get_binary_op(ast->attr);
|
binary_op_type op = get_binary_op(ast->attr);
|
||||||
ret = op(result, &op1, &op2);
|
op(result, &op1, &op2);
|
||||||
zval_ptr_dtor_nogc(&op1);
|
zval_ptr_dtor_nogc(&op1);
|
||||||
zval_ptr_dtor_nogc(&op2);
|
zval_ptr_dtor_nogc(&op2);
|
||||||
|
ret = EG(exception) ? FAILURE : SUCCESS;
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case ZEND_AST_GREATER:
|
case ZEND_AST_GREATER:
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue