Patch print-r.patch for amqp Bug #62953
Patch version 2012-09-05 20:53 UTC
Return to Bug #62953 |
Download this patch
Patch Revisions:
Developer: bkw@codingforce.com
commit 738f413ade12070441cb227f86d7e7f0bcf154f4
Author: Bernhard K. Weisshuhn <bkw@codingforce.com>
Date: Wed Sep 5 21:39:23 2012 +0200
memcpy zend_objects_handlers for debug_info
diff --git a/amqp_channel.c b/amqp_channel.c
index 1b52ba6..6ee129f 100644
--- a/amqp_channel.c
+++ b/amqp_channel.c
@@ -43,6 +43,7 @@
#include "amqp_connection.h"
#if PHP_MAJOR_VERSION == 5 && PHP_MINOR_VERSION >= 3
+zend_object_handlers amqp_channel_object_handlers;
HashTable *amqp_channel_object_get_debug_info(zval *object, int *is_temp TSRMLS_DC) {
zval *value;
@@ -111,10 +112,9 @@ zend_object_value amqp_channel_ctor(zend_class_entry *ce TSRMLS_DC)
);
#if PHP_MAJOR_VERSION == 5 && PHP_MINOR_VERSION >= 3
- zend_object_handlers *handlers;
- handlers = zend_get_std_object_handlers();
- handlers->get_debug_info = amqp_channel_object_get_debug_info;
- new_value.handlers = handlers;
+ memcpy((void *)&amqp_channel_object_handlers, (void *)zend_get_std_object_handlers(), sizeof(zend_object_handlers));
+ amqp_channel_object_handlers.get_debug_info = amqp_channel_object_get_debug_info;
+ new_value.handlers = &amqp_channel_object_handlers;
#else
new_value.handlers = zend_get_std_object_handlers();
#endif
diff --git a/amqp_connection.c b/amqp_connection.c
index 1e960e1..808e5e8 100644
--- a/amqp_connection.c
+++ b/amqp_connection.c
@@ -42,6 +42,8 @@
#include "php_amqp.h"
#if PHP_MAJOR_VERSION == 5 && PHP_MINOR_VERSION >= 3
+zend_object_handlers amqp_connection_object_handlers;
+
HashTable *amqp_connection_object_get_debug_info(zval *object, int *is_temp TSRMLS_DC) {
zval *value;
@@ -358,10 +360,9 @@ zend_object_value amqp_connection_ctor(zend_class_entry *ce TSRMLS_DC)
);
#if PHP_MAJOR_VERSION == 5 && PHP_MINOR_VERSION >= 3
- zend_object_handlers *handlers;
- handlers = zend_get_std_object_handlers();
- handlers->get_debug_info = amqp_connection_object_get_debug_info;
- new_value.handlers = handlers;
+ memcpy((void *)&amqp_connection_object_handlers, (void *)zend_get_std_object_handlers(), sizeof(zend_object_handlers));
+ amqp_connection_object_handlers.get_debug_info = amqp_connection_object_get_debug_info;
+ new_value.handlers = &amqp_connection_object_handlers;
#else
new_value.handlers = zend_get_std_object_handlers();
#endif
diff --git a/amqp_envelope.c b/amqp_envelope.c
index 51ded52..b243de8 100644
--- a/amqp_envelope.c
+++ b/amqp_envelope.c
@@ -42,6 +42,7 @@
#include "php_amqp.h"
#if PHP_MAJOR_VERSION == 5 && PHP_MINOR_VERSION >= 3
+zend_object_handlers amqp_envelope_object_handlers;
HashTable *amqp_envelope_object_get_debug_info(zval *object, int *is_temp TSRMLS_DC) {
zval *value;
@@ -165,10 +166,9 @@ zend_object_value amqp_envelope_ctor(zend_class_entry *ce TSRMLS_DC)
new_value.handle = zend_objects_store_put(envelope, (zend_objects_store_dtor_t)zend_objects_destroy_object, (zend_objects_free_object_storage_t)amqp_envelope_dtor, NULL TSRMLS_CC);
#if PHP_MAJOR_VERSION == 5 && PHP_MINOR_VERSION >= 3
- zend_object_handlers *handlers;
- handlers = zend_get_std_object_handlers();
- handlers->get_debug_info = amqp_envelope_object_get_debug_info;
- new_value.handlers = handlers;
+ memcpy((void *)&amqp_envelope_object_handlers, (void *)zend_get_std_object_handlers(), sizeof(zend_object_handlers));
+ amqp_envelope_object_handlers.get_debug_info = amqp_envelope_object_get_debug_info;
+ new_value.handlers = &amqp_envelope_object_handlers;
#else
new_value.handlers = zend_get_std_object_handlers();
#endif
diff --git a/amqp_exchange.c b/amqp_exchange.c
index cd21af3..85965ea 100644
--- a/amqp_exchange.c
+++ b/amqp_exchange.c
@@ -43,6 +43,7 @@
#if PHP_MAJOR_VERSION == 5 && PHP_MINOR_VERSION >= 3
+zend_object_handlers amqp_exchange_object_handlers;
HashTable *amqp_exchange_object_get_debug_info(zval *object, int *is_temp TSRMLS_DC) {
zval *value;
@@ -120,10 +121,9 @@ zend_object_value amqp_exchange_ctor(zend_class_entry *ce TSRMLS_DC)
);
#if PHP_MAJOR_VERSION == 5 && PHP_MINOR_VERSION >= 3
- zend_object_handlers *handlers;
- handlers = zend_get_std_object_handlers();
- handlers->get_debug_info = amqp_exchange_object_get_debug_info;
- new_value.handlers = handlers;
+ memcpy((void *)&amqp_exchange_object_handlers, (void *)zend_get_std_object_handlers(), sizeof(zend_object_handlers));
+ amqp_exchange_object_handlers.get_debug_info = amqp_exchange_object_get_debug_info;
+ new_value.handlers = &amqp_exchange_object_handlers;
#else
new_value.handlers = zend_get_std_object_handlers();
#endif
diff --git a/amqp_queue.c b/amqp_queue.c
index 4fd5fae..b4154d3 100644
--- a/amqp_queue.c
+++ b/amqp_queue.c
@@ -43,6 +43,7 @@
#if PHP_MAJOR_VERSION == 5 && PHP_MINOR_VERSION >= 3
+zend_object_handlers amqp_queue_object_handlers;
HashTable *amqp_queue_object_get_debug_info(zval *object, int *is_temp TSRMLS_DC) {
zval *value;
@@ -131,10 +132,9 @@ zend_object_value amqp_queue_ctor(zend_class_entry *ce TSRMLS_DC)
);
#if PHP_MAJOR_VERSION == 5 && PHP_MINOR_VERSION >= 3
- zend_object_handlers *handlers;
- handlers = zend_get_std_object_handlers();
- handlers->get_debug_info = amqp_queue_object_get_debug_info;
- new_value.handlers = handlers;
+ memcpy((void *)&amqp_queue_object_handlers, (void *)zend_get_std_object_handlers(), sizeof(zend_object_handlers));
+ amqp_queue_object_handlers.get_debug_info = amqp_queue_object_get_debug_info;
+ new_value.handlers = &amqp_queue_object_handlers;
#else
new_value.handlers = zend_get_std_object_handlers();
#endif
|