X-Git-Url: https://git.m6w6.name/?a=blobdiff_plain;f=src%2Fphp_pqstm.c;h=af0eb15ea8c9707e69e09b64abaf913835205fa2;hb=19011ee23e5bdb9a46778e190a61e4ce6c765be7;hp=4b71038a63f10167c2266b5d2fb966f834c75707;hpb=94be2af75078af30116718bb2df201d9e5a47e5b;p=m6w6%2Fext-pq diff --git a/src/php_pqstm.c b/src/php_pqstm.c index 4b71038..af0eb15 100644 --- a/src/php_pqstm.c +++ b/src/php_pqstm.c @@ -164,12 +164,12 @@ ZEND_BEGIN_ARG_INFO_EX(ai_pqstm_bind, 0, 0, 2) ZEND_END_ARG_INFO(); static PHP_METHOD(pqstm, bind) { long param_no; - zval *param_ref; + zval **param_ref; zend_error_handling zeh; STATUS rv; zend_replace_error_handling(EH_THROW, exce(EX_INVALID_ARGUMENT), &zeh TSRMLS_CC); - rv = zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "lz", ¶m_no, ¶m_ref); + rv = zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "lZ", ¶m_no, ¶m_ref); zend_restore_error_handling(&zeh TSRMLS_CC); if (SUCCESS == rv) { @@ -178,8 +178,9 @@ static PHP_METHOD(pqstm, bind) { if (!obj->intern) { throw_exce(EX_UNINITIALIZED TSRMLS_CC, "pq\\Statement not initialized"); } else { - Z_ADDREF_P(param_ref); - zend_hash_index_update(&obj->intern->bound, param_no, (void *) ¶m_ref, sizeof(zval *), NULL); + SEPARATE_ZVAL_TO_MAKE_IS_REF(param_ref); + Z_ADDREF_PP(param_ref); + zend_hash_index_update(&obj->intern->bound, param_no, (void *) param_ref, sizeof(zval *), NULL); zend_hash_sort(&obj->intern->bound, zend_qsort, compare_index, 0 TSRMLS_CC); } }