@@ -772,7 +772,7 @@ static bool do_fetch(pdo_stmt_t *stmt, zval *return_value, enum pdo_fetch_type h
772
772
* See ext/pdo/tests/bug_38253.phpt */
773
773
if (UNEXPECTED (ce == NULL )) {
774
774
pdo_raise_impl_error (stmt -> dbh , stmt , "HY000" , "No fetch class specified" );
775
- return false ;
775
+ goto in_fetch_error ;
776
776
}
777
777
ctor_arguments = stmt -> fetch .cls .ctor_args ;
778
778
}
@@ -781,7 +781,7 @@ static bool do_fetch(pdo_stmt_t *stmt, zval *return_value, enum pdo_fetch_type h
781
781
if (!ce -> unserialize ) {
782
782
/* As this option is deprecated we do not bother to mention the class name. */
783
783
pdo_raise_impl_error (stmt -> dbh , stmt , "HY000" , "cannot unserialize class" );
784
- return false ;
784
+ goto in_fetch_error ;
785
785
}
786
786
} else {
787
787
if (UNEXPECTED (object_init_ex (return_value , ce ) != SUCCESS )) {
@@ -791,7 +791,7 @@ static bool do_fetch(pdo_stmt_t *stmt, zval *return_value, enum pdo_fetch_type h
791
791
bool failed = pdo_call_fetch_object_constructor (ce -> constructor , ctor_arguments , return_value );
792
792
if (UNEXPECTED (failed )) {
793
793
zval_ptr_dtor (return_value );
794
- return false ;
794
+ goto in_fetch_error ;
795
795
}
796
796
}
797
797
}
@@ -803,7 +803,7 @@ static bool do_fetch(pdo_stmt_t *stmt, zval *return_value, enum pdo_fetch_type h
803
803
* See ext/pdo/tests/bug_38253.phpt */
804
804
if (stmt -> fetch .into == NULL ) {
805
805
pdo_raise_impl_error (stmt -> dbh , stmt , "HY000" , "No fetch-into object specified." );
806
- return false ;
806
+ goto in_fetch_error ;
807
807
}
808
808
809
809
ZVAL_OBJ_COPY (return_value , stmt -> fetch .into );
@@ -819,7 +819,7 @@ static bool do_fetch(pdo_stmt_t *stmt, zval *return_value, enum pdo_fetch_type h
819
819
* See ext/pdo/tests/bug_38253.phpt */
820
820
if (UNEXPECTED (!ZEND_FCC_INITIALIZED (stmt -> fetch .func .fcc ))) {
821
821
pdo_raise_impl_error (stmt -> dbh , stmt , "HY000" , "No fetch function specified" );
822
- return false ;
822
+ goto in_fetch_error ;
823
823
}
824
824
/* There will be at most stmt->column_count parameters.
825
825
* However, if we fetch a group key we will have over allocated. */
@@ -849,7 +849,7 @@ static bool do_fetch(pdo_stmt_t *stmt, zval *return_value, enum pdo_fetch_type h
849
849
if (unserialize_res == FAILURE ) {
850
850
pdo_raise_impl_error (stmt -> dbh , stmt , "HY000" , "cannot unserialize class" );
851
851
zval_ptr_dtor (return_value );
852
- return false ;
852
+ goto in_fetch_error ;
853
853
}
854
854
column_index_to_fetch ++ ;
855
855
}
@@ -929,7 +929,7 @@ static bool do_fetch(pdo_stmt_t *stmt, zval *return_value, enum pdo_fetch_type h
929
929
bool failed = pdo_call_fetch_object_constructor (ce -> constructor , ctor_arguments , return_value );
930
930
if (UNEXPECTED (failed )) {
931
931
zval_ptr_dtor (return_value );
932
- return false ;
932
+ goto in_fetch_error ;
933
933
}
934
934
} else if (how == PDO_FETCH_FUNC ) {
935
935
zend_call_known_fcc (& stmt -> fetch .func .fcc , return_value , fetch_function_param_num , fetch_function_params , NULL );
@@ -942,6 +942,10 @@ static bool do_fetch(pdo_stmt_t *stmt, zval *return_value, enum pdo_fetch_type h
942
942
stmt -> in_fetch = false;
943
943
944
944
return true;
945
+
946
+ in_fetch_error :
947
+ stmt -> in_fetch = false;
948
+ return false;
945
949
}
946
950
/* }}} */
947
951
0 commit comments