Skip to content

Commit

Permalink
fix seg error for php7 pecl
Browse files Browse the repository at this point in the history
  • Loading branch information
hetao committed Mar 24, 2016
1 parent 6af0895 commit 42d5764
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 2 deletions.
9 changes: 8 additions & 1 deletion pecl/slightphp7.c
Original file line number Diff line number Diff line change
Expand Up @@ -214,7 +214,7 @@ PHP_METHOD(slightphp, getZoneAlias)

PHP_METHOD(slightphp, setDebug)
{
int _debug;
zend_long _debug;
if (zend_parse_parameters(ZEND_NUM_ARGS() , "l", &_debug) == FAILURE) {
RETURN_FALSE;
}
Expand Down Expand Up @@ -420,6 +420,13 @@ PHP_METHOD(slightphp, run)
if(slightphp_load(appDir,zone,page ) == SUCCESS){
if(slightphp_run(zone,page,entry,return_value,1,params )==SUCCESS){
zval_dtor(&path_array);
if(appDir)zval_dtor(appDir);
if(zone)zval_dtor(zone);
if(page)zval_dtor(page);
if(entry)zval_dtor(entry);
if(zoneAlias)zval_dtor(zoneAlias);
if(path)zval_dtor(path);
zval_dtor(params);
RETURN_ZVAL(return_value,1,0);
};
}
Expand Down
2 changes: 1 addition & 1 deletion pecl/slightphp_globals7.c
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ int debug(char*format,...){
TSRMLS_FETCH();
zval *_debug_flag = zend_read_static_property(slightphp_ce_ptr,"_debug",sizeof("_debug")-1,1 );
convert_to_long(_debug_flag);
int size;
int size=0;
if(Z_LVAL_P(_debug_flag))
{
va_list args;
Expand Down

0 comments on commit 42d5764

Please sign in to comment.