summaryrefslogtreecommitdiff
path: root/ext/intl/resourcebundle/resourcebundle_class.h
diff options
context:
space:
mode:
authorGustavo Lopes <glopes@nebm.ist.utl.pt>2012-08-21 23:21:59 +0200
committerGustavo Lopes <glopes@nebm.ist.utl.pt>2012-08-22 22:32:51 +0200
commita5d0c1e21b9fa166d8fe5ec7d52a24a5f7adc107 (patch)
tree2ed39a52ede3d5e9dce93ffa5e0b1aff39698b69 /ext/intl/resourcebundle/resourcebundle_class.h
parente5bdd2c0eeab50dc1f863dae9a32d3857ece6a79 (diff)
downloadphp-git-a5d0c1e21b9fa166d8fe5ec7d52a24a5f7adc107.tar.gz
Fix handling of several uinitialized intl objects
Diffstat (limited to 'ext/intl/resourcebundle/resourcebundle_class.h')
-rw-r--r--ext/intl/resourcebundle/resourcebundle_class.h11
1 files changed, 10 insertions, 1 deletions
diff --git a/ext/intl/resourcebundle/resourcebundle_class.h b/ext/intl/resourcebundle/resourcebundle_class.h
index 4755d723b8..8da3ed9d47 100644
--- a/ext/intl/resourcebundle/resourcebundle_class.h
+++ b/ext/intl/resourcebundle/resourcebundle_class.h
@@ -33,7 +33,16 @@ typedef struct {
} ResourceBundle_object;
#define RESOURCEBUNDLE_METHOD_INIT_VARS INTL_METHOD_INIT_VARS(ResourceBundle, rb)
-#define RESOURCEBUNDLE_METHOD_FETCH_OBJECT INTL_METHOD_FETCH_OBJECT(ResourceBundle, rb)
+#define RESOURCEBUNDLE_METHOD_FETCH_OBJECT_NO_CHECK INTL_METHOD_FETCH_OBJECT(ResourceBundle, rb)
+#define RESOURCEBUNDLE_METHOD_FETCH_OBJECT \
+ INTL_METHOD_FETCH_OBJECT(ResourceBundle, rb); \
+ if (RESOURCEBUNDLE_OBJECT(rb) == NULL) { \
+ intl_errors_set(&rb->error, U_ILLEGAL_ARGUMENT_ERROR, \
+ "Found unconstructed ResourceBundle", 0 TSRMLS_CC); \
+ RETURN_FALSE; \
+ }
+
+
#define RESOURCEBUNDLE_OBJECT(rb) (rb)->me
void resourcebundle_register_class( TSRMLS_D );