what happens when we call hpt_to_php with TSRMLS_CC?

This commit is contained in:
Meredith L. Patterson 2013-12-21 18:55:44 +01:00
parent bb58af5738
commit c67391cfbb

View file

@ -1,6 +1,6 @@
%module hammer; %module hammer;
#ifdef ZTS #ifdef ZTS
void ***tsrm_ls; // void ***tsrm_ls;
#endif #endif
%include "exception.i"; %include "exception.i";
%{ %{
@ -79,7 +79,7 @@
//SWIG_exception(SWIG_TypeError, "typemap: should have been an HParseResult*, was NULL"); //SWIG_exception(SWIG_TypeError, "typemap: should have been an HParseResult*, was NULL");
RETVAL_NULL(); RETVAL_NULL();
} else { } else {
hpt_to_php($1->ast, $result); hpt_to_php($1->ast, $result TSRMLS_CC);
} }
} }
@ -146,7 +146,7 @@
for (int i=0; i < token->token_data.seq->used; i++) { for (int i=0; i < token->token_data.seq->used; i++) {
zval *tmp; zval *tmp;
ALLOC_INIT_ZVAL(tmp); ALLOC_INIT_ZVAL(tmp);
hpt_to_php(token->token_data.seq->elements[i], tmp); hpt_to_php(token->token_data.seq->elements[i], tmp TSRMLS_CC);
add_next_index_zval(return_value, tmp); add_next_index_zval(return_value, tmp);
} }
break; break;
@ -176,7 +176,7 @@
MAKE_STD_ZVAL(args[0]); MAKE_STD_ZVAL(args[0]);
ALLOC_INIT_ZVAL(ret); ALLOC_INIT_ZVAL(ret);
ZVAL_STRING(&func, (const char*)user_data, 0); ZVAL_STRING(&func, (const char*)user_data, 0);
hpt_to_php(p->ast, args[0]); hpt_to_php(p->ast, args[0] TSRMLS_CC);
int ok = call_user_function(EG(function_table), NULL, &func, ret, 1, args TSRMLS_CC); int ok = call_user_function(EG(function_table), NULL, &func, ret, 1, args TSRMLS_CC);
if (ok != SUCCESS) { if (ok != SUCCESS) {
printf("call_user_function failed\n"); printf("call_user_function failed\n");
@ -197,7 +197,7 @@
MAKE_STD_ZVAL(args[0]); MAKE_STD_ZVAL(args[0]);
ALLOC_INIT_ZVAL(ret); ALLOC_INIT_ZVAL(ret);
ZVAL_STRING(&func, (const char*)user_data, 0); ZVAL_STRING(&func, (const char*)user_data, 0);
hpt_to_php(p->ast, args[0]); hpt_to_php(p->ast, args[0] TSRMLS_CC);
int ok = call_user_function(EG(function_table), NULL, &func, ret, 1, args TSRMLS_CC); int ok = call_user_function(EG(function_table), NULL, &func, ret, 1, args TSRMLS_CC);
if (ok != SUCCESS) { if (ok != SUCCESS) {
printf("call_user_function failed\n"); printf("call_user_function failed\n");