summaryrefslogtreecommitdiff
path: root/ext/intl/formatter/formatter_class.h
diff options
context:
space:
mode:
Diffstat (limited to 'ext/intl/formatter/formatter_class.h')
-rw-r--r--[-rwxr-xr-x]ext/intl/formatter/formatter_class.h15
1 files changed, 12 insertions, 3 deletions
diff --git a/ext/intl/formatter/formatter_class.h b/ext/intl/formatter/formatter_class.h
index cf1cb060c6..9582866664 100755..100644
--- a/ext/intl/formatter/formatter_class.h
+++ b/ext/intl/formatter/formatter_class.h
@@ -34,8 +34,17 @@ extern zend_class_entry *NumberFormatter_ce_ptr;
/* Auxiliary macros */
-#define FORMATTER_METHOD_INIT_VARS INTL_METHOD_INIT_VARS(NumberFormatter, nfo)
-#define FORMATTER_METHOD_FETCH_OBJECT INTL_METHOD_FETCH_OBJECT(NumberFormatter, nfo)
-#define FORMATTER_OBJECT(nfo) (nfo)->nf_data.unum
+#define FORMATTER_METHOD_INIT_VARS INTL_METHOD_INIT_VARS(NumberFormatter, nfo)
+#define FORMATTER_OBJECT(nfo) (nfo)->nf_data.unum
+#define FORMATTER_METHOD_FETCH_OBJECT_NO_CHECK INTL_METHOD_FETCH_OBJECT(NumberFormatter, nfo)
+#define FORMATTER_METHOD_FETCH_OBJECT \
+ FORMATTER_METHOD_FETCH_OBJECT_NO_CHECK; \
+ if (FORMATTER_OBJECT(nfo) == NULL) \
+ { \
+ intl_errors_set(&nfo->nf_data.error, U_ILLEGAL_ARGUMENT_ERROR, \
+ "Found unconstructed NumberFormatter", 0 TSRMLS_CC); \
+ RETURN_FALSE; \
+ }
+
#endif // #ifndef FORMATTER_CLASS_H