From 259d050a39cf24c21237055598b5c5a52aea2565 Mon Sep 17 00:00:00 2001 From: Nikita Popov Date: Fri, 14 Aug 2020 16:56:25 +0200 Subject: [PATCH] Clean up BreakIterator create_object handler Use standard zend_object_alloc() function and fix the object_init_properties() call (which works out okay because there are no properties). --- ext/intl/breakiterator/breakiterator_class.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/ext/intl/breakiterator/breakiterator_class.cpp b/ext/intl/breakiterator/breakiterator_class.cpp index 2114ada558..3f236db2d4 100644 --- a/ext/intl/breakiterator/breakiterator_class.cpp +++ b/ext/intl/breakiterator/breakiterator_class.cpp @@ -69,7 +69,7 @@ U_CFUNC void breakiterator_object_construct(zval *object, BreakIterator_object *bio; BREAKITER_METHOD_FETCH_OBJECT_NO_CHECK; //populate to from object - assert(bio->biter == NULL); + ZEND_ASSERT(bio->biter == NULL); bio->biter = biter; } @@ -203,10 +203,10 @@ static zend_object *BreakIterator_object_create(zend_class_entry *ce) { BreakIterator_object* intern; - intern = (BreakIterator_object*)ecalloc(1, sizeof(BreakIterator_object) + sizeof(zval) * (ce->default_properties_count - 1)); + intern = (BreakIterator_object*) zend_object_alloc(sizeof(BreakIterator_object), ce); zend_object_std_init(&intern->zo, ce); - object_properties_init((zend_object*) intern, ce); + object_properties_init(&intern->zo, ce); breakiterator_object_init(intern); intern->zo.handlers = &BreakIterator_handlers; -- 2.40.0