Use the general zend_generator_throw_exception() helper for this.
Otherwise we don't handle the off-by-one opline correctly (should
we maybe just stop doing that?)
This is a followup to
ad750c3bb6e7b48384c6265eb9d3bcf5b4000652,
which fixed a different yield from exception handling problem that
happened to show up in the same test case from oss-fuzz #25321.
Now both issues should be fixed.
function gen() {
try {
- yield from new FooBar;
+ // the fact that the yield from result is used is relevant.
+ var_dump(yield from new FooBar);
} catch (Exception $e) {
echo $e->getMessage(), "\n";
}
return SUCCESS;
exception:
- zend_rethrow_exception(generator->execute_data);
+ zend_generator_throw_exception(generator, NULL);
failure:
zval_ptr_dtor(&generator->values);