diff options
| author | Xinchen Hui <laruence@gmail.com> | 2016-07-21 14:25:36 +0800 |
|---|---|---|
| committer | Xinchen Hui <laruence@gmail.com> | 2016-07-21 14:25:36 +0800 |
| commit | bdd3f77be05f786a0140f835c04b114fe26c7272 (patch) | |
| tree | 273ac4b1e2b8877d3b7c9ee1a2b350dc8de5b6e2 /ext/intl | |
| parent | c9af9c78f1977e0a88446750ddbc6dc740877df7 (diff) | |
| parent | 4a643e5e1362951362b5eb4a30af0d5068ca6686 (diff) | |
| download | php-git-bdd3f77be05f786a0140f835c04b114fe26c7272.tar.gz | |
Merge branch 'PHP-7.0' into PHP-7.1
* PHP-7.0:
Fixed bug #72639 (Segfault when instantiating class that extends IntlCalendar and adds a property)
Diffstat (limited to 'ext/intl')
| -rw-r--r-- | ext/intl/calendar/calendar_class.cpp | 2 | ||||
| -rw-r--r-- | ext/intl/tests/bug72639.phpt | 17 |
2 files changed, 18 insertions, 1 deletions
diff --git a/ext/intl/calendar/calendar_class.cpp b/ext/intl/calendar/calendar_class.cpp index d8a9995100..a2024c0712 100644 --- a/ext/intl/calendar/calendar_class.cpp +++ b/ext/intl/calendar/calendar_class.cpp @@ -254,7 +254,7 @@ static zend_object *Calendar_object_create(zend_class_entry *ce) intern = (Calendar_object*)ecalloc(1, sizeof(Calendar_object) + sizeof(zval) * (ce->default_properties_count - 1)); zend_object_std_init(&intern->zo, ce); - object_properties_init((zend_object*) intern, ce); + object_properties_init(&intern->zo, ce); calendar_object_init(intern); diff --git a/ext/intl/tests/bug72639.phpt b/ext/intl/tests/bug72639.phpt new file mode 100644 index 0000000000..2c94dcc06f --- /dev/null +++ b/ext/intl/tests/bug72639.phpt @@ -0,0 +1,17 @@ +--TEST-- +Bug #72639 (Segfault when instantiating class that extends IntlCalendar and adds a property) +--SKIPIF-- +<?php if( !extension_loaded( 'intl' ) ) print 'skip'; ?> +--FILE-- +<?php +class A extends IntlCalendar { + public function __construct() {} + private $a; +} +var_dump(new A()); +?> +--EXPECTF-- +object(A)#%d (1) { + ["valid"]=> + bool(false) +} |
