Skip to content

Commit

Permalink
Fix #1340
Browse files Browse the repository at this point in the history
(cherry picked from commit 2c7c1f8)

Conflicts:
	ext/kernel/memory.h
  • Loading branch information
sjinks committed Oct 9, 2013
1 parent 4a5da47 commit f903d98
Showing 1 changed file with 9 additions and 10 deletions.
19 changes: 9 additions & 10 deletions ext/kernel/memory.h
Original file line number Diff line number Diff line change
Expand Up @@ -139,17 +139,15 @@ extern void PHALCON_FASTCALL phalcon_copy_ctor(zval *destiny, zval *origin);
}

#define PHALCON_SEPARATE_PARAM(z) \
{\
do { \
zval *orig_ptr = z;\
if (Z_REFCOUNT_P(orig_ptr) > 1) {\
phalcon_memory_observe(&z TSRMLS_CC);\
ALLOC_ZVAL(z);\
*z = *orig_ptr;\
zval_copy_ctor(z);\
Z_SET_REFCOUNT_P(z, 1);\
Z_UNSET_ISREF_P(z);\
}\
}
phalcon_memory_observe(&z TSRMLS_CC);\
ALLOC_ZVAL(z);\
*z = *orig_ptr;\
zval_copy_ctor(z);\
Z_SET_REFCOUNT_P(z, 1);\
Z_UNSET_ISREF_P(z);\
} while (0)

#define PHALCON_SEPARATE_PARAM_NMO(z) { \
zval *orig_ptr = z; \
Expand All @@ -168,3 +166,4 @@ extern void PHALCON_FASTCALL phalcon_copy_ctor(zval *destiny, zval *origin);
} else { \
zval_ptr_dtor(&var); \
}

0 comments on commit f903d98

Please sign in to comment.