Skip to content
Permalink
Browse files

Merge pull request #5886 from mapserver/backport-5879-to-branch-7-4

[Backport branch-7-4] mapscript/php: Fix segfault in ms_newprojectionobj in PHP7.3
  • Loading branch information...
rouault committed Oct 1, 2019
2 parents c299900 + b5b646f commit 1538df8c7b8bcbdd343ffdab7409d928f9412e10
Showing with 3 additions and 3 deletions.
  1. +3 −3 mapscript/php/php_mapscript_util.h
@@ -146,8 +146,8 @@ static zend_always_inline zend_bool zval_set_isref_to_p(zval* pz, zend_bool isre
#endif /* PHP_VERSION_ID < 70000 */

#if PHP_VERSION_ID >= 70300
#define MAPSCRIPT_ADDREF(zv) zend_gc_addref(&(Z_COUNTED(zv))->gc)
#define MAPSCRIPT_ADDREF_P(p) zend_gc_addref(&(Z_COUNTED_P(p))->gc)
#define MAPSCRIPT_ADDREF(zv) if(!Z_ISUNDEF(zv)) GC_ADDREF(Z_COUNTED(zv))
#define MAPSCRIPT_ADDREF_P(p) if(!Z_ISUNDEF(*p)) GC_ADDREF(Z_COUNTED_P(p))
#else
#if PHP_VERSION_ID >= 70000
#define MAPSCRIPT_ADDREF(zv) if(!(Z_ISUNDEF(zv))) GC_REFCOUNT(Z_COUNTED(zv))++;
@@ -163,7 +163,7 @@ static zend_always_inline zend_bool zval_set_isref_to_p(zval* pz, zend_bool isre
if (!(Z_ISUNDEF(zv))) \
{ \
zend_refcounted *_gc = Z_COUNTED(zv); \
zend_gc_delref(&_gc->gc); \
GC_DELREF(_gc); \
if(GC_REFCOUNT(_gc) == 0) \
rc_dtor_func(_gc); \
ZVAL_UNDEF(&zv); \

0 comments on commit 1538df8

Please sign in to comment.
You can’t perform that action at this time.