@@ -155,7 +155,6 @@ PHP_METHOD(SQLite3, open)
155
155
#endif
156
156
157
157
db_obj -> initialised = 1 ;
158
- db_obj -> authorizer_fci = empty_fcall_info ;
159
158
db_obj -> authorizer_fcc = empty_fcall_info_cache ;
160
159
161
160
sqlite3_set_authorizer (db_obj -> db , php_sqlite3_authorizer , db_obj );
@@ -1288,16 +1287,14 @@ PHP_METHOD(SQLite3, setAuthorizer)
1288
1287
SQLITE3_CHECK_INITIALIZED (db_obj , db_obj -> initialised , SQLite3 )
1289
1288
1290
1289
/* Clear previously set callback */
1291
- if (ZEND_FCI_INITIALIZED (db_obj -> authorizer_fci )) {
1292
- zval_ptr_dtor (& db_obj -> authorizer_fci .function_name );
1293
- db_obj -> authorizer_fci .size = 0 ;
1290
+ if (ZEND_FCC_INITIALIZED (db_obj -> authorizer_fcc )) {
1291
+ zend_fcc_dtor (& db_obj -> authorizer_fcc );
1294
1292
}
1295
1293
1296
1294
/* Only enable userland authorizer if argument is not NULL */
1297
1295
if (ZEND_FCI_INITIALIZED (fci )) {
1298
- db_obj -> authorizer_fci = fci ;
1299
- Z_ADDREF (db_obj -> authorizer_fci .function_name );
1300
1296
db_obj -> authorizer_fcc = fcc ;
1297
+ zend_fcc_addref (& db_obj -> authorizer_fcc );
1301
1298
}
1302
1299
1303
1300
RETURN_TRUE ;
@@ -2064,10 +2061,9 @@ static int php_sqlite3_authorizer(void *autharg, int action, const char *arg1, c
2064
2061
}
2065
2062
2066
2063
php_sqlite3_db_object * db_obj = (php_sqlite3_db_object * )autharg ;
2067
- zend_fcall_info * fci = & db_obj -> authorizer_fci ;
2068
2064
2069
2065
/* fallback to access allowed if authorizer callback is not defined */
2070
- if (fci -> size == 0 ) {
2066
+ if (! ZEND_FCC_INITIALIZED ( db_obj -> authorizer_fcc ) ) {
2071
2067
return SQLITE_OK ;
2072
2068
}
2073
2069
@@ -2101,13 +2097,10 @@ static int php_sqlite3_authorizer(void *autharg, int action, const char *arg1, c
2101
2097
ZVAL_STRING (& argv [4 ], arg4 );
2102
2098
}
2103
2099
2104
- fci -> retval = & retval ;
2105
- fci -> param_count = 5 ;
2106
- fci -> params = argv ;
2107
-
2108
2100
int authreturn = SQLITE_DENY ;
2109
2101
2110
- if (zend_call_function (fci , & db_obj -> authorizer_fcc ) != SUCCESS || Z_ISUNDEF (retval )) {
2102
+ zend_call_known_fcc (& db_obj -> authorizer_fcc , & retval , /* argc */ 5 , argv , /* named_params */ NULL );
2103
+ if (Z_ISUNDEF (retval )) {
2111
2104
php_sqlite3_error (db_obj , "An error occurred while invoking the authorizer callback" );
2112
2105
} else {
2113
2106
if (Z_TYPE (retval ) != IS_LONG ) {
@@ -2122,8 +2115,13 @@ static int php_sqlite3_authorizer(void *autharg, int action, const char *arg1, c
2122
2115
}
2123
2116
}
2124
2117
2125
- zend_fcall_info_args_clear ( fci , 0 );
2118
+ /* Free local return and argument values */
2126
2119
zval_ptr_dtor (& retval );
2120
+ zval_ptr_dtor (& argv [0 ]);
2121
+ zval_ptr_dtor (& argv [1 ]);
2122
+ zval_ptr_dtor (& argv [2 ]);
2123
+ zval_ptr_dtor (& argv [3 ]);
2124
+ zval_ptr_dtor (& argv [4 ]);
2127
2125
2128
2126
return authreturn ;
2129
2127
}
@@ -2165,8 +2163,8 @@ static void php_sqlite3_object_free_storage(zend_object *object) /* {{{ */
2165
2163
}
2166
2164
2167
2165
/* Release function_name from authorizer */
2168
- if (intern -> authorizer_fci . size > 0 ) {
2169
- zval_ptr_dtor (& intern -> authorizer_fci . function_name );
2166
+ if (ZEND_FCC_INITIALIZED ( intern -> authorizer_fcc ) ) {
2167
+ zend_fcc_dtor (& intern -> authorizer_fcc );
2170
2168
}
2171
2169
2172
2170
while (intern -> funcs ) {
0 commit comments