]> granicus.if.org Git - php/commitdiff
ZEND_COMPILE_GUARDS compiler option
authorJoe Watkins <krakjoe@php.net>
Sun, 20 Sep 2015 05:23:36 +0000 (06:23 +0100)
committerBob Weinand <bobwei9@hotmail.com>
Wed, 23 Sep 2015 13:33:57 +0000 (15:33 +0200)
Zend/zend_compile.c
Zend/zend_compile.h

index 1323dbc7785af6f0297a282a4786d896b218ed87..2e98f10c6a45c446bc3caa4dc497a32349110328 100644 (file)
@@ -1608,6 +1608,10 @@ ZEND_API void zend_initialize_class_data(zend_class_entry *ce, zend_bool nullify
        ce->refcount = 1;
        ce->ce_flags = ZEND_ACC_CONSTANTS_UPDATED;
 
+       if (CG(compiler_options) & ZEND_COMPILE_GUARDS) {
+               ce->ce_flags |= ZEND_ACC_USE_GUARDS;
+       }
+
        ce->default_properties_table = NULL;
        ce->default_static_members_table = NULL;
        zend_hash_init_ex(&ce->properties_info, 8, NULL, (persistent_hashes ? zend_destroy_property_info_internal : NULL), persistent_hashes, 0);
index dae8d173a0a1b0e90c8cca61a78d5149b71f2fc7..06c7d02149d71421a58450fec748bed85eab7d0f 100644 (file)
@@ -1005,6 +1005,9 @@ END_EXTERN_C()
 /* generate ZEND_INIT_FCALL_BY_NAME for userland functions instead of ZEND_INIT_FCALL */
 #define ZEND_COMPILE_IGNORE_USER_FUNCTIONS      (1<<8)
 
+/* force IS_OBJ_USE_GUARDS for all classes */
+#define ZEND_COMPILE_GUARDS                                            (1<<9)
+
 /* The default value for CG(compiler_options) */
 #define ZEND_COMPILE_DEFAULT                                   ZEND_COMPILE_HANDLE_OP_ARRAY