Skip to content

Commit 540f052

Browse files
committed
Fix zpp in mysqli_warning::next()
This only exists as a method, so using zend_parse_method_parameters doesn't make sense. Also make sure that zpp is always called, not only conditionally.
1 parent b5d8fc0 commit 540f052

File tree

1 file changed

+6
-8
lines changed

1 file changed

+6
-8
lines changed

ext/mysqli/mysqli_warning.c

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -175,16 +175,14 @@ MYSQLI_WARNING * php_get_warnings(MYSQLND_CONN_DATA * mysql)
175175
PHP_METHOD(mysqli_warning, next)
176176
{
177177
MYSQLI_WARNING *w;
178-
zval *mysqli_warning;
179-
mysqli_object *obj = Z_MYSQLI_P(getThis());
178+
mysqli_object *obj = Z_MYSQLI_P(ZEND_THIS);
180179

181-
if (obj->ptr) {
182-
if (zend_parse_method_parameters(ZEND_NUM_ARGS(), getThis(), "O",
183-
&mysqli_warning, mysqli_warning_class_entry) == FAILURE) {
184-
RETURN_THROWS();
185-
}
180+
if (zend_parse_parameters_none() == FAILURE) {
181+
RETURN_THROWS();
182+
}
186183

187-
MYSQLI_FETCH_RESOURCE(w, MYSQLI_WARNING *, mysqli_warning, "mysqli_warning", MYSQLI_STATUS_VALID);
184+
if (obj->ptr) {
185+
MYSQLI_FETCH_RESOURCE(w, MYSQLI_WARNING *, ZEND_THIS, "mysqli_warning", MYSQLI_STATUS_VALID);
188186

189187
if (w && w->next) {
190188
w = w->next;

0 commit comments

Comments
 (0)