@@ -684,8 +684,7 @@ static bool do_fetch_func_prepare(pdo_stmt_t *stmt) /* {{{ */
684
684
685
685
static void do_fetch_opt_finish (pdo_stmt_t * stmt , int free_ctor_agrs ) /* {{{ */
686
686
{
687
- /* fci.size is used to check if it is valid */
688
- if (stmt -> fetch .cls .fci .size && stmt -> fetch .cls .fci .params ) {
687
+ if (ZEND_FCI_INITIALIZED (stmt -> fetch .cls .fci ) && stmt -> fetch .cls .fci .params ) {
689
688
if (!Z_ISUNDEF (stmt -> fetch .cls .ctor_args )) {
690
689
/* Added to free constructor arguments */
691
690
zend_fcall_info_args_clear (& stmt -> fetch .cls .fci , 1 );
@@ -695,6 +694,7 @@ static void do_fetch_opt_finish(pdo_stmt_t *stmt, int free_ctor_agrs) /* {{{ */
695
694
stmt -> fetch .cls .fci .params = NULL ;
696
695
}
697
696
697
+ /* Invalidate FCI */
698
698
stmt -> fetch .cls .fci .size = 0 ;
699
699
if (!Z_ISUNDEF (stmt -> fetch .cls .ctor_args ) && free_ctor_agrs ) {
700
700
zval_ptr_dtor (& stmt -> fetch .cls .ctor_args );
@@ -833,7 +833,7 @@ static bool do_fetch(pdo_stmt_t *stmt, zval *return_value, enum pdo_fetch_type h
833
833
if (UNEXPECTED (object_init_ex (return_value , ce ) != SUCCESS )) {
834
834
return 0 ;
835
835
}
836
- if (!stmt -> fetch .cls .fci . size ) {
836
+ if (!ZEND_FCI_INITIALIZED ( stmt -> fetch .cls .fci ) ) {
837
837
if (!do_fetch_class_prepare (stmt )) {
838
838
zval_ptr_dtor (return_value );
839
839
return 0 ;
@@ -879,7 +879,7 @@ static bool do_fetch(pdo_stmt_t *stmt, zval *return_value, enum pdo_fetch_type h
879
879
pdo_raise_impl_error (stmt -> dbh , stmt , "HY000" , "No fetch function specified" );
880
880
return 0 ;
881
881
}
882
- if (!stmt -> fetch .func .fci . size ) {
882
+ if (!ZEND_FCI_INITIALIZED ( stmt -> fetch .func .fci ) ) {
883
883
if (!do_fetch_func_prepare (stmt ))
884
884
{
885
885
return 0 ;
0 commit comments