summaryrefslogtreecommitdiff
path: root/ext/intl/breakiterator/rulebasedbreakiterator_methods.cpp
diff options
context:
space:
mode:
authorDmitry Stogov <dmitry@zend.com>2015-03-30 18:53:38 +0300
committerDmitry Stogov <dmitry@zend.com>2015-03-30 18:53:38 +0300
commit1018f462d8bb0a12b238d9d11c141038beaf2a6c (patch)
tree6466aa51c3924c5ed56741e02fa323fcb3e2ece4 /ext/intl/breakiterator/rulebasedbreakiterator_methods.cpp
parent9155a267adeeb6f442f97892de441e4b6666ce73 (diff)
downloadphp-git-1018f462d8bb0a12b238d9d11c141038beaf2a6c.tar.gz
Patch improvement:
Removed the corresponding core code. Fixed ext/com_dotnet and ext/date. Refactored ext/intl changes. Improved ext/fileinfo and ext/pdo changes. Fixed tests.
Diffstat (limited to 'ext/intl/breakiterator/rulebasedbreakiterator_methods.cpp')
-rw-r--r--ext/intl/breakiterator/rulebasedbreakiterator_methods.cpp11
1 files changed, 7 insertions, 4 deletions
diff --git a/ext/intl/breakiterator/rulebasedbreakiterator_methods.cpp b/ext/intl/breakiterator/rulebasedbreakiterator_methods.cpp
index c112134124..b43f8212d0 100644
--- a/ext/intl/breakiterator/rulebasedbreakiterator_methods.cpp
+++ b/ext/intl/breakiterator/rulebasedbreakiterator_methods.cpp
@@ -24,6 +24,7 @@ extern "C" {
}
#include "../intl_convertcpp.h"
+#include "../intl_common.h"
static inline RuleBasedBreakIterator *fetch_rbbi(BreakIterator_object *bio) {
return (RuleBasedBreakIterator*)bio->biter;
@@ -97,15 +98,17 @@ static void _php_intlrbbi_constructor_body(INTERNAL_FUNCTION_PARAMETERS)
U_CFUNC PHP_METHOD(IntlRuleBasedBreakIterator, __construct)
{
- zval orig_this = *getThis();
+ zend_error_handling error_handling;
+ zend_replace_error_handling(EH_THROW, IntlException_ce_ptr, &error_handling);
return_value = getThis();
_php_intlrbbi_constructor_body(INTERNAL_FUNCTION_PARAM_PASSTHRU);
-
if (Z_TYPE_P(return_value) == IS_OBJECT && Z_OBJ_P(return_value) == NULL) {
- zend_object_store_ctor_failed(Z_OBJ(orig_this));
- ZEND_CTOR_MAKE_NULL();
+ if (!EG(exception)) {
+ zend_throw_exception(IntlException_ce_ptr, "Constructor failed", 0);
+ }
}
+ zend_restore_error_handling(&error_handling);
}
U_CFUNC PHP_FUNCTION(rbbi_get_rules)