Discussion:
com php/gtk-src: Well at least make the var_dump work and stop crashing: main/phpg_support.c
Elizabeth Marie Smith
2012-07-17 15:41:23 UTC
Permalink
Commit: 8853964256ab57b1b7ee8e076b05fb968e21c998
Author: Elizabeth M Smith <***@gmail.com> Tue, 17 Jul 2012 11:41:23 -0400
Parents: 84e3370df4e9e56a1a2e9ec632679c42ad593349
Branches: master

Link: http://git.php.net/?p=php/gtk-src.git;a=commitdiff;h=8853964256ab57b1b7ee8e076b05fb968e21c998

Log:
Well at least make the var_dump work and stop crashing

Changed paths:
M main/phpg_support.c


Diff:
diff --git a/main/phpg_support.c b/main/phpg_support.c
index cee6364..d5064c6 100644
--- a/main/phpg_support.c
+++ b/main/phpg_support.c
@@ -177,19 +177,26 @@ HashTable* phpg_get_properties(zval *object TSRMLS_DC)
int ret;

poh = (phpg_head_t *) zend_object_store_get_object(object TSRMLS_CC);
- pi_hash = poh->pi_hash;
- for (zend_hash_internal_pointer_reset(pi_hash);
- zend_hash_get_current_data(pi_hash, (void **)&pi) == SUCCESS;
- zend_hash_move_forward(pi_hash)) {
-
- ret = pi->read(poh, &result TSRMLS_CC);
- if (ret == SUCCESS) {
- ALLOC_ZVAL(result_ptr);
- *result_ptr = result;
- INIT_PZVAL(result_ptr);
- zend_hash_update(poh->zobj.properties, (char *)pi->name, strlen(pi->name)+1, &result_ptr, sizeof(zval *), NULL);
- }
- }
+
+ if (!poh->zobj.properties) {
+ rebuild_object_properties(&poh->zobj);
+ }
+
+ if (poh->pi_hash) {
+ pi_hash = poh->pi_hash;
+ for (zend_hash_internal_pointer_reset(pi_hash);
+ zend_hash_get_current_data(pi_hash, (void **)&pi) == SUCCESS;
+ zend_hash_move_forward(pi_hash)) {
+
+ ret = pi->read(poh, &result TSRMLS_CC);
+ if (ret == SUCCESS) {
+ ALLOC_ZVAL(result_ptr);
+ *result_ptr = result;
+ INIT_PZVAL(result_ptr);
+ zend_hash_update(poh->zobj.properties, (char *)pi->name, strlen(pi->name)+1, &result_ptr, sizeof(zval *), NULL);
+ }
+ }
+ }

return poh->zobj.properties;
}
--
PHP-GTK CVS Mailing List (http://gtk.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
Loading...