Skip to content

Commit e5e8d17

Browse files
committed
Fix object instantiation
com_dotnet objects are special, since they still have the `zend_object` as first member, so we need to use a somewhat different initialization.
1 parent 046fce2 commit e5e8d17

File tree

1 file changed

+4
-6
lines changed

1 file changed

+4
-6
lines changed

ext/com_dotnet/com_saproxy.c

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -57,13 +57,11 @@ typedef struct {
5757

5858
#define SA_FETCH(zv) (php_com_saproxy*)Z_OBJ_P(zv)
5959

60-
zend_object *php_com_saproxy_create_object(zend_class_entry *class_type) {
61-
php_com_saproxy *intern = zend_object_alloc(sizeof(php_com_saproxy), class_type);
62-
memset((char*)intern + sizeof(zend_object), 0, sizeof(php_com_saproxy) - sizeof(zend_object));
63-
60+
zend_object *php_com_saproxy_create_object(zend_class_entry *class_type)
61+
{
62+
php_com_saproxy *intern = emalloc(sizeof(*intern));
63+
memset(intern, 0, sizeof(*intern));
6464
zend_object_std_init(&intern->std, class_type);
65-
object_properties_init(&intern->std, class_type);
66-
6765
return &intern->std;
6866
}
6967

0 commit comments

Comments
 (0)