From 45fbecb25395a18d23c94a7ca7b3af24a1f80acd Mon Sep 17 00:00:00 2001 From: Vladimir Kolesnikov Date: Sat, 3 Aug 2013 14:42:49 +0300 Subject: [PATCH] Fix segfault when GC is on (cherry picked from commit c4afe0acc2342b736f9e1b020e1e85c3b2a4d5b6) --- ext/config.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/ext/config.c b/ext/config.c index 8baa396d903..15ce6f4fb2c 100644 --- a/ext/config.c +++ b/ext/config.c @@ -262,7 +262,11 @@ static HashTable* phalcon_config_get_properties(zval* object TSRMLS_DC) { HashTable* props = zend_std_get_properties(object TSRMLS_CC); phalcon_config_object* obj = fetchPhalconConfigObject(object TSRMLS_CC); - zend_hash_copy(props, obj->props, (copy_ctor_func_t)zval_add_ref, NULL, sizeof(zval*)); + + if (!GC_G(gc_active)) { + zend_hash_copy(props, obj->props, (copy_ctor_func_t)zval_add_ref, NULL, sizeof(zval*)); + } + return props; }