diff options
author | Zeev Suraski <zeev@php.net> | 1999-08-07 23:04:01 +0000 |
---|---|---|
committer | Zeev Suraski <zeev@php.net> | 1999-08-07 23:04:01 +0000 |
commit | 720d32f5819fb0a1a75dce31afc1fd957a7d4a12 (patch) | |
tree | d65f3bc2b04c85f88277079bffd657fc089a67f6 /Zend | |
parent | 7ceaa82d301d6f80a6c374e257848412bfb6b8f3 (diff) | |
download | php-git-720d32f5819fb0a1a75dce31afc1fd957a7d4a12.tar.gz |
Fix a few leaks
Diffstat (limited to 'Zend')
-rw-r--r-- | Zend/zend_compile.h | 1 | ||||
-rw-r--r-- | Zend/zend_execute.c | 6 | ||||
-rw-r--r-- | Zend/zend_execute_API.c | 4 |
3 files changed, 6 insertions, 5 deletions
diff --git a/Zend/zend_compile.h b/Zend/zend_compile.h index 570ef109e0..c7b6e89f2e 100644 --- a/Zend/zend_compile.h +++ b/Zend/zend_compile.h @@ -556,6 +556,7 @@ int zendlex(znode *zendlval CLS_DC); #define PZVAL_LOCK(z) (z)->EA.locks++ #define PZVAL_UNLOCK(z) (z)->EA.locks-- +#define SELECTIVE_PZVAL_LOCK(pzv, pzn) if (!((pzn)->u.EA.type & EXT_TYPE_UNUSED)) { PZVAL_LOCK(pzv); } #endif /* _COMPILE_H */ diff --git a/Zend/zend_execute.c b/Zend/zend_execute.c index f141e3b931..0ddafac5bb 100644 --- a/Zend/zend_execute.c +++ b/Zend/zend_execute.c @@ -36,8 +36,6 @@ #include "zend_extensions.h" -#define SELECTIVE_PZVAL_LOCK(pzv, pzn) if (!((pzn)->u.EA.type & EXT_TYPE_UNUSED)) { PZVAL_LOCK(pzv); } - #define get_zval_ptr(node, Ts, should_free, type) _get_zval_ptr(node, Ts, should_free ELS_CC) #define get_zval_ptr_ptr(node, Ts, type) _get_zval_ptr_ptr(node, Ts ELS_CC) @@ -1691,7 +1689,9 @@ send_by_ref: case ZEND_SWITCH_FREE: switch (opline->op1.op_type) { case IS_VAR: - get_zval_ptr(&opline->op1, Ts, &free_op1, BP_VAR_R); + if (!Ts[opline->op1.u.var].var) { + get_zval_ptr(&opline->op1, Ts, &free_op1, BP_VAR_R); + } FREE_OP(&opline->op1, free_op1); break; case IS_TMP_VAR: diff --git a/Zend/zend_execute_API.c b/Zend/zend_execute_API.c index 1a5d9e2cbc..c71085fe6d 100644 --- a/Zend/zend_execute_API.c +++ b/Zend/zend_execute_API.c @@ -205,7 +205,7 @@ ZEND_API inline void safe_free_zval_ptr(zval *p) ZEND_API int zval_ptr_dtor(zval **zval_ptr) { - int locked = PZVAL_IS_LOCKED(*zval_ptr); + int locked = (*zval_ptr)->EA.locks; #if DEBUG_ZEND>=2 printf("Reducing refcount for %x (%x): %d->%d\n", *zval_ptr, zval_ptr, (*zval_ptr)->refcount, (*zval_ptr)->refcount-1); @@ -497,7 +497,7 @@ ZEND_API inline void zend_assign_to_variable_reference(znode *result, zval **var if (result && (result->op_type != IS_UNUSED)) { Ts[result->u.var].var = variable_ptr_ptr; - PZVAL_LOCK(*variable_ptr_ptr); + SELECTIVE_PZVAL_LOCK(*variable_ptr_ptr, result); } } |