]> granicus.if.org Git - php/commitdiff
Use RETURN_THROWS() after zend_throw_error()
authorMáté Kocsis <kocsismate@woohoolabs.com>
Wed, 1 Jan 2020 15:42:30 +0000 (16:42 +0100)
committerMáté Kocsis <kocsismate@woohoolabs.com>
Wed, 1 Jan 2020 15:42:30 +0000 (16:42 +0100)
14 files changed:
Zend/zend_exceptions.c
ext/date/php_date.c
ext/dom/document.c
ext/ffi/ffi.c
ext/hash/hash.c
ext/intl/collator/collator_compare.c
ext/intl/collator/collator_locale.c
ext/intl/collator/collator_sort.c
ext/mysqli/mysqli.c
ext/reflection/php_reflection.c
ext/session/session.c
ext/standard/array.c
ext/standard/basic_functions.c
ext/standard/dir.c

index 19ec415c7317f3d1eb35a1a6ab318e1599bde8cd..a7a1f41f597e4d9701d1416012912d20fffa1b19 100644 (file)
@@ -289,7 +289,7 @@ ZEND_METHOD(exception, __construct)
                        ce = base_ce;
                }
                zend_throw_error(NULL, "Wrong parameters for %s([string $message [, long $code [, Throwable $previous = NULL]]])", ZSTR_VAL(ce->name));
-               return;
+               RETURN_THROWS();
        }
 
        if (message) {
@@ -355,7 +355,7 @@ ZEND_METHOD(error_exception, __construct)
                        ce = zend_ce_error_exception;
                }
                zend_throw_error(NULL, "Wrong parameters for %s([string $message [, long $code, [ long $severity, [ string $filename, [ long $lineno  [, Throwable $previous = NULL]]]]]])", ZSTR_VAL(ce->name));
-               return;
+               RETURN_THROWS();
        }
 
        object = ZEND_THIS;
index 1c3c11fc35b1ab3e9c8320196f3cab000537004d..13fd7e005e3765d35c9077e07251e83ed2697a0c 100644 (file)
@@ -302,7 +302,7 @@ static zend_object_handlers date_object_handlers_period;
 #define DATE_CHECK_INITIALIZED(member, class_name) \
        if (!(member)) { \
                zend_throw_error(NULL, "The " #class_name " object has not been correctly initialized by its constructor"); \
-               return; \
+               RETURN_THROWS(); \
        }
 
 static void date_object_free_storage_date(zend_object *object);
index 07eaec58f8865cbaa552959fe39449175ce9f6c4..473593e8a7e1f3e32de18810f11fae19071abac5 100644 (file)
@@ -1730,7 +1730,7 @@ static void _dom_document_schema_validate(INTERNAL_FUNCTION_PARAMETERS, int type
        if (!vptr) {
                xmlSchemaFree(sptr);
                zend_throw_error(NULL, "Invalid Schema Validation Context");
-               RETURN_FALSE;
+               RETURN_THROWS();
        }
 
        if (flags & XML_SCHEMA_VAL_VC_I_CREATE) {
@@ -1829,7 +1829,7 @@ static void _dom_document_relaxNG_validate(INTERNAL_FUNCTION_PARAMETERS, int typ
        if (!vptr) {
                xmlRelaxNGFree(sptr);
                zend_throw_error(NULL, "Invalid RelaxNG Validation Context");
-               RETURN_FALSE;
+               RETURN_THROWS();
        }
 
        xmlRelaxNGSetValidErrors(vptr, php_libxml_error_handler, php_libxml_error_handler, vptr);
index 6a6292105bc2e956d5eca7d4c8124cee98f14d44..25dd1d95d4599cf39d8b2fead03e4cdf1b2104a0 100644 (file)
@@ -2819,7 +2819,7 @@ ZEND_METHOD(FFI, cdef) /* {{{ */
                handle = DL_LOAD(ZSTR_VAL(lib));
                if (!handle) {
                        zend_throw_error(zend_ffi_exception_ce, "Failed loading '%s'", ZSTR_VAL(lib));
-                       return;
+                       RETURN_THROWS();
                }
 #ifdef RTLD_DEFAULT
        } else if (1) {
@@ -3345,7 +3345,7 @@ ZEND_METHOD(FFI, load) /* {{{ */
 
        if (CG(compiler_options) & ZEND_COMPILE_PRELOAD_IN_CHILD) {
                zend_throw_error(zend_ffi_exception_ce, "FFI::load() doesn't work in conjunction with \"opcache.preload_user\". Use \"ffi.preload\" instead.");
-               return;
+               RETURN_THROWS();
        }
 
        ffi = zend_ffi_load(ZSTR_VAL(fn), (CG(compiler_options) & ZEND_COMPILE_PRELOAD) != 0);
@@ -3373,7 +3373,7 @@ ZEND_METHOD(FFI, scope) /* {{{ */
 
        if (!scope) {
                zend_throw_error(zend_ffi_exception_ce, "Failed loading scope '%s'", ZSTR_VAL(scope_name));
-               return;
+               RETURN_THROWS();
        }
 
        ffi = (zend_ffi*)zend_ffi_new(zend_ffi_ce);
@@ -3687,7 +3687,7 @@ ZEND_METHOD(FFI, free) /* {{{ */
        if (ZEND_FFI_TYPE(cdata->type)->kind == ZEND_FFI_TYPE_POINTER) {
                if (!cdata->ptr) {
                        zend_throw_error(zend_ffi_exception_ce, "NULL pointer dereference");
-                       return;
+                       RETURN_THROWS();
                }
                if (cdata->ptr != (void*)&cdata->ptr_holder) {
                        pefree(*(void**)cdata->ptr, cdata->flags & ZEND_FFI_FLAG_PERSISTENT);
@@ -3857,7 +3857,7 @@ ZEND_METHOD(FFI, cast) /* {{{ */
        } else if (type->size > old_type->size) {
                zend_object_release(&cdata->std);
                zend_throw_error(zend_ffi_exception_ce, "attempt to cast to larger type");
-               return;
+               RETURN_THROWS();
        } else if (ptr != &old_cdata->ptr_holder) {
                cdata->ptr = ptr;
        } else {
@@ -4001,16 +4001,16 @@ ZEND_METHOD(FFI, arrayType) /* {{{ */
 
        if (type->kind == ZEND_FFI_TYPE_FUNC) {
                zend_throw_error(zend_ffi_exception_ce, "array of functions is not allowed");
-               return;
+               RETURN_THROWS();
        } else if (type->kind == ZEND_FFI_TYPE_ARRAY && (type->attr & ZEND_FFI_ATTR_INCOMPLETE_ARRAY)) {
                zend_throw_error(zend_ffi_exception_ce, "only the leftmost array can be undimensioned");
-               return;
+               RETURN_THROWS();
        } else if (type->kind == ZEND_FFI_TYPE_VOID) {
                zend_throw_error(zend_ffi_exception_ce, "array of 'void' is not allowed");
-               return;
+               RETURN_THROWS();
        } else if (type->attr & ZEND_FFI_ATTR_INCOMPLETE_TAG) {
                zend_throw_error(zend_ffi_exception_ce, "array of incomplete type is not allowed");
-               return;
+               RETURN_THROWS();
        }
 
        if (ZEND_FFI_TYPE_IS_OWNED(ctype->type)) {
@@ -4032,11 +4032,11 @@ ZEND_METHOD(FFI, arrayType) /* {{{ */
                if (n < 0) {
                        zend_throw_error(zend_ffi_exception_ce, "negative array index");
                        zend_ffi_type_dtor(type);
-                       return;
+                       RETURN_THROWS();
                } else if (ZEND_FFI_TYPE(type)->kind == ZEND_FFI_TYPE_ARRAY && (ZEND_FFI_TYPE(type)->attr & ZEND_FFI_ATTR_INCOMPLETE_ARRAY)) {
                        zend_throw_error(zend_ffi_exception_ce, "only the leftmost array can be undimensioned");
                        zend_ffi_type_dtor(type);
-                       return;
+                       RETURN_THROWS();
                }
 
                new_type = emalloc(sizeof(zend_ffi_type));
@@ -4187,7 +4187,7 @@ ZEND_METHOD(FFI, memcpy) /* {{{ */
                ptr1 = cdata1->ptr;
                if (type1->kind != ZEND_FFI_TYPE_POINTER && size > type1->size) {
                        zend_throw_error(zend_ffi_exception_ce, "attempt to write over data boundary");
-                       return;
+                       RETURN_THROWS();
                }
        }
 
@@ -4196,7 +4196,7 @@ ZEND_METHOD(FFI, memcpy) /* {{{ */
                ptr2 = Z_STRVAL_P(zv2);
                if (size > Z_STRLEN_P(zv2)) {
                        zend_throw_error(zend_ffi_exception_ce, "attempt to read over string boundary");
-                       return;
+                       RETURN_THROWS();
                }
        } else if (Z_TYPE_P(zv2) == IS_OBJECT && Z_OBJCE_P(zv2) == zend_ffi_cdata_ce) {
                cdata2 = (zend_ffi_cdata*)Z_OBJ_P(zv2);
@@ -4207,7 +4207,7 @@ ZEND_METHOD(FFI, memcpy) /* {{{ */
                        ptr2 = cdata2->ptr;
                        if (type2->kind != ZEND_FFI_TYPE_POINTER && size > type2->size) {
                                zend_throw_error(zend_ffi_exception_ce, "attempt to read over data boundary");
-                               return;
+                               RETURN_THROWS();
                        }
                }
        } else {
@@ -4240,7 +4240,7 @@ ZEND_METHOD(FFI, memcmp) /* {{{ */
                ptr1 = Z_STRVAL_P(zv1);
                if (size > Z_STRLEN_P(zv1)) {
                        zend_throw_error(zend_ffi_exception_ce, "attempt to read over string boundary");
-                       return;
+                       RETURN_THROWS();
                }
        } else if (Z_TYPE_P(zv1) == IS_OBJECT && Z_OBJCE_P(zv1) == zend_ffi_cdata_ce) {
                cdata1 = (zend_ffi_cdata*)Z_OBJ_P(zv1);
@@ -4251,7 +4251,7 @@ ZEND_METHOD(FFI, memcmp) /* {{{ */
                        ptr1 = cdata1->ptr;
                        if (type1->kind != ZEND_FFI_TYPE_POINTER && size > type1->size) {
                                zend_throw_error(zend_ffi_exception_ce, "attempt to read over data boundary");
-                               return;
+                               RETURN_THROWS();
                        }
                }
        } else {
@@ -4264,7 +4264,7 @@ ZEND_METHOD(FFI, memcmp) /* {{{ */
                ptr2 = Z_STRVAL_P(zv2);
                if (size > Z_STRLEN_P(zv2)) {
                        zend_throw_error(zend_ffi_exception_ce, "attempt to read over string boundary");
-                       return;
+                       RETURN_THROWS();
                }
        } else if (Z_TYPE_P(zv2) == IS_OBJECT && Z_OBJCE_P(zv2) == zend_ffi_cdata_ce) {
                cdata2 = (zend_ffi_cdata*)Z_OBJ_P(zv2);
@@ -4275,7 +4275,7 @@ ZEND_METHOD(FFI, memcmp) /* {{{ */
                        ptr2 = cdata2->ptr;
                        if (type2->kind != ZEND_FFI_TYPE_POINTER && size > type2->size) {
                                zend_throw_error(zend_ffi_exception_ce, "attempt to read over data boundary");
-                               return;
+                               RETURN_THROWS();
                        }
                }
        } else {
@@ -4317,7 +4317,7 @@ ZEND_METHOD(FFI, memset) /* {{{ */
                ptr = cdata->ptr;
                if (type->kind != ZEND_FFI_TYPE_POINTER && size > type->size) {
                        zend_throw_error(zend_ffi_exception_ce, "attempt to write over data boundary");
-                       return;
+                       RETURN_THROWS();
                }
        }
 
@@ -4349,7 +4349,7 @@ ZEND_METHOD(FFI, string) /* {{{ */
                        ptr = cdata->ptr;
                        if (type->kind != ZEND_FFI_TYPE_POINTER && size > type->size) {
                                zend_throw_error(zend_ffi_exception_ce, "attempt to read over data boundary");
-                               return;
+                               RETURN_THROWS();
                        }
                }
                RETURN_STRINGL((char*)ptr, size);
@@ -4360,7 +4360,7 @@ ZEND_METHOD(FFI, string) /* {{{ */
                        ptr = cdata->ptr;
                } else {
                        zend_throw_error(zend_ffi_exception_ce, "FFI\\Cdata is not a C string");
-                       return;
+                       RETURN_THROWS();
                }
                RETURN_STRING((char*)ptr);
        }
@@ -4389,7 +4389,7 @@ ZEND_METHOD(FFI, isNull) /* {{{ */
 
        if (type->kind != ZEND_FFI_TYPE_POINTER){
                zend_throw_error(zend_ffi_exception_ce, "FFI\\Cdata is not a pointer");
-               return;
+               RETURN_THROWS();
        }
 
        RETURN_BOOL(*(void**)cdata->ptr == NULL);
index 60ab85379e9feaca8b347eb2853b586c5d1cd07e..b79894a33b51ba16b02b6d3c9f54419ef780324a 100644 (file)
@@ -253,17 +253,17 @@ static void php_hash_do_hash_hmac(INTERNAL_FUNCTION_PARAMETERS, int isfilename,
        ops = php_hash_fetch_ops(algo, algo_len);
        if (!ops) {
                zend_throw_error(NULL, "Unknown hashing algorithm: %s", algo);
-               return;
+               RETURN_THROWS();
        }
        else if (!ops->is_crypto) {
                zend_throw_error(NULL, "Non-cryptographic hashing algorithm: %s", algo);
-               return;
+               RETURN_THROWS();
        }
 
        if (isfilename) {
                if (CHECK_NULL_PATH(data, data_len)) {
                        zend_throw_error(NULL, "Invalid path");
-                       return;
+                       RETURN_THROWS();
                }
                stream = php_stream_open_wrapper_ex(data, "rb", REPORT_ERRORS, NULL, FG(default_context));
                if (!stream) {
@@ -359,18 +359,18 @@ PHP_FUNCTION(hash_init)
        ops = php_hash_fetch_ops(ZSTR_VAL(algo), ZSTR_LEN(algo));
        if (!ops) {
                zend_throw_error(NULL, "Unknown hashing algorithm: %s", ZSTR_VAL(algo));
-               return;
+               RETURN_THROWS();
        }
 
        if (options & PHP_HASH_HMAC) {
                if (!ops->is_crypto) {
                        zend_throw_error(NULL, "HMAC requested with a non-cryptographic hashing algorithm: %s", ZSTR_VAL(algo));
-                       return;
+                       RETURN_THROWS();
                }
                if (!key || (ZSTR_LEN(key) == 0)) {
                        /* Note: a zero length key is no key at all */
                        zend_throw_error(NULL, "HMAC requested without a key");
-                       return;
+                       RETURN_THROWS();
                }
        }
 
@@ -415,7 +415,7 @@ PHP_FUNCTION(hash_init)
 #define PHP_HASHCONTEXT_VERIFY(func, hash) { \
        if (!hash->context) { \
                zend_throw_error(NULL, "%s(): supplied resource is not a valid Hash Context resource", func); \
-               return; \
+               RETURN_THROWS(); \
        } \
 }
 
@@ -587,7 +587,7 @@ PHP_FUNCTION(hash_copy)
                zval_ptr_dtor(return_value);
 
                zend_throw_error(NULL, "Cannot copy hash");
-               return;
+               RETURN_THROWS();
        }
 }
 /* }}} */
@@ -648,27 +648,27 @@ PHP_FUNCTION(hash_hkdf)
        ops = php_hash_fetch_ops(ZSTR_VAL(algo), ZSTR_LEN(algo));
        if (!ops) {
                zend_throw_error(NULL, "Unknown hashing algorithm: %s", ZSTR_VAL(algo));
-               return;
+               RETURN_THROWS();
        }
 
        if (!ops->is_crypto) {
                zend_throw_error(NULL, "Non-cryptographic hashing algorithm: %s", ZSTR_VAL(algo));
-               return;
+               RETURN_THROWS();
        }
 
        if (ZSTR_LEN(ikm) == 0) {
                zend_throw_error(NULL, "Input keying material cannot be empty");
-               return;
+               RETURN_THROWS();
        }
 
        if (length < 0) {
                zend_throw_error(NULL, "Length must be greater than or equal to 0: " ZEND_LONG_FMT, length);
-               return;
+               RETURN_THROWS();
        } else if (length == 0) {
                length = ops->digest_size;
        } else if (length > (zend_long) (ops->digest_size * 255)) {
                zend_throw_error(NULL, "Length must be less than or equal to %zd: " ZEND_LONG_FMT, ops->digest_size * 255, length);
-               return;
+               RETURN_THROWS();
        }
 
        context = emalloc(ops->context_size);
@@ -748,26 +748,26 @@ PHP_FUNCTION(hash_pbkdf2)
        ops = php_hash_fetch_ops(algo, algo_len);
        if (!ops) {
                zend_throw_error(NULL, "Unknown hashing algorithm: %s", algo);
-               return;
+               RETURN_THROWS();
        }
        else if (!ops->is_crypto) {
                zend_throw_error(NULL, "Non-cryptographic hashing algorithm: %s", algo);
-               return;
+               RETURN_THROWS();
        }
 
        if (iterations <= 0) {
                zend_throw_error(NULL, "Iterations must be a positive integer: " ZEND_LONG_FMT, iterations);
-               return;
+               RETURN_THROWS();
        }
 
        if (length < 0) {
                zend_throw_error(NULL, "Length must be greater than or equal to 0: " ZEND_LONG_FMT, length);
-               return;
+               RETURN_THROWS();
        }
 
        if (salt_len > INT_MAX - 4) {
                zend_throw_error(NULL, "Supplied salt is too long, max of INT_MAX - 4 bytes: %zd supplied", salt_len);
-               return;
+               RETURN_THROWS();
        }
 
        context = emalloc(ops->context_size);
index 4b6ad1fb92686fda10abeaca3c418bcceec50acf..17d5aff12ef9b1b5ea2bafcfc387a6a7f03db1fc 100644 (file)
@@ -59,7 +59,7 @@ PHP_FUNCTION( collator_compare )
                        "Object not initialized", 0 );
                zend_throw_error(NULL, "Object not initialized");
 
-               RETURN_FALSE;
+               RETURN_THROWS();
        }
 
        /*
index f669fb471760d2534f16b6d0ffcefd88b8619033..66390c2d327766be7b534fa636727ddf998d5ace 100644 (file)
@@ -52,7 +52,7 @@ PHP_FUNCTION( collator_get_locale )
                        "Object not initialized", 0 );
                zend_throw_error(NULL, "Object not initialized");
 
-               RETURN_FALSE;
+               RETURN_THROWS();
        }
 
        /* Get locale by specified type. */
index 0ed58790e462bb19126e32bfafa9b848e4e80182..bd235d804d722cf1d88fd9a6a0758d042dadeeea 100644 (file)
@@ -404,7 +404,7 @@ PHP_FUNCTION( collator_sort_with_sort_keys )
                        "Object not initialized", 0 );
                zend_throw_error(NULL, "Object not initialized");
 
-               RETURN_FALSE;
+               RETURN_THROWS();
        }
 
        /*
@@ -567,7 +567,7 @@ PHP_FUNCTION( collator_get_sort_key )
                        "Object not initialized", 0 );
                zend_throw_error(NULL, "Object not initialized");
 
-               RETURN_FALSE;
+               RETURN_THROWS();
        }
 
        /*
index 4bb8ee76c135e136f8ac36663d8fa86a7169160f..a4baa58dcb2e3c6f5324786fc61c81c2e6ce94c6 100644 (file)
@@ -1209,19 +1209,19 @@ void php_mysqli_fetch_into_hash(INTERNAL_FUNCTION_PARAMETERS, int override_flags
                }
                if (UNEXPECTED(ce->ce_flags & (ZEND_ACC_INTERFACE|ZEND_ACC_TRAIT|ZEND_ACC_IMPLICIT_ABSTRACT_CLASS|ZEND_ACC_EXPLICIT_ABSTRACT_CLASS))) {
                        zend_throw_error(NULL, "Class '%s' cannot be instantiated", ZSTR_VAL(ce->name));
-                       return;
+                       RETURN_THROWS();
                }
                fetchtype = MYSQLI_ASSOC;
        } else {
                if (override_flags) {
                        if (zend_parse_method_parameters(ZEND_NUM_ARGS(), getThis(), "O", &mysql_result, mysqli_result_class_entry) == FAILURE) {
-                               return;
+                               RETURN_THROWS();
                        }
                        fetchtype = override_flags;
                } else {
                        fetchtype = MYSQLI_BOTH;
                        if (zend_parse_method_parameters(ZEND_NUM_ARGS(), getThis(), "O|l", &mysql_result, mysqli_result_class_entry, &fetchtype) == FAILURE) {
-                               return;
+                               RETURN_THROWS();
                        }
                }
        }
index 61a0de16d6b16157763964a6e45935437533d4e9..ad98bc63210319066b23b61bcbdf5770d9267a09 100644 (file)
@@ -96,7 +96,7 @@ PHPAPI zend_class_entry *reflection_reference_ptr;
                        return; \
                } \
                zend_throw_error(NULL, "Internal error: Failed to retrieve the reflection object"); \
-               return; \
+               RETURN_THROWS(); \
        } \
 } while (0)
 
index 0b95af0232f33643d64ece9f6e8e18efa0617e64..03a53641dc7b098d732c26d9983c53f828761b14 100644 (file)
@@ -2221,14 +2221,14 @@ static PHP_FUNCTION(session_regenerate_id)
        if (PS(mod)->s_open(&PS(mod_data), PS(save_path), PS(session_name)) == FAILURE) {
                PS(session_status) = php_session_none;
                zend_throw_error(NULL, "Failed to open session: %s (path: %s)", PS(mod)->s_name, PS(save_path));
-               RETURN_FALSE;
+               RETURN_THROWS();
        }
 
        PS(id) = PS(mod)->s_create_sid(&PS(mod_data));
        if (!PS(id)) {
                PS(session_status) = php_session_none;
                zend_throw_error(NULL, "Failed to create new session ID: %s (path: %s)", PS(mod)->s_name, PS(save_path));
-               RETURN_FALSE;
+               RETURN_THROWS();
        }
        if (PS(use_strict_mode) && PS(mod)->s_validate_sid &&
                PS(mod)->s_validate_sid(&PS(mod_data), PS(id)) == FAILURE) {
@@ -2238,7 +2238,7 @@ static PHP_FUNCTION(session_regenerate_id)
                        PS(mod)->s_close(&PS(mod_data));
                        PS(session_status) = php_session_none;
                        zend_throw_error(NULL, "Failed to create session ID by collision: %s (path: %s)", PS(mod)->s_name, PS(save_path));
-                       RETURN_FALSE;
+                       RETURN_THROWS();
                }
        }
        /* Read is required to make new session data at this point. */
@@ -2246,7 +2246,7 @@ static PHP_FUNCTION(session_regenerate_id)
                PS(mod)->s_close(&PS(mod_data));
                PS(session_status) = php_session_none;
                zend_throw_error(NULL, "Failed to create(read) session ID: %s (path: %s)", PS(mod)->s_name, PS(save_path));
-               RETURN_FALSE;
+               RETURN_THROWS();
        }
        if (data) {
                zend_string_release_ex(data, 0);
index f8d4256aeed6a427741407aa26511c1d23735b6e..4fbd5506ea035f8393ab42f189a992318515ed2f 100644 (file)
@@ -3173,7 +3173,7 @@ PHP_FUNCTION(array_push)
                if (zend_hash_next_index_insert(Z_ARRVAL_P(stack), &new_var) == NULL) {
                        Z_TRY_DELREF(new_var);
                        zend_throw_error(NULL, "Cannot add element to the array as the next element is already occupied");
-                       return;
+                       RETURN_THROWS();
                }
        }
 
index 59e31b5e6246d6894fd172db1c56cee94e719b01..8f1907f3beec86ff71312c4ed9c8fff368ce7fb7 100755 (executable)
@@ -2341,7 +2341,7 @@ PHP_FUNCTION(forward_static_call)
 
        if (!EX(prev_execute_data)->func->common.scope) {
                zend_throw_error(NULL, "Cannot call forward_static_call() when no class scope is active");
-               return;
+               RETURN_THROWS();
        }
 
        fci.retval = &retval;
index 2e4637e78c801cbbfa387f03ae5ca9aab7fe6be5..2ef8344aed8544cfedf68ff035bd99d750c27326 100644 (file)
@@ -68,7 +68,7 @@ static zend_class_entry *dir_class_entry_ptr;
                if (myself) { \
                        if ((tmp = zend_hash_str_find(Z_OBJPROP_P(myself), "handle", sizeof("handle")-1)) == NULL) { \
                                zend_throw_error(NULL, "Unable to find my handle property"); \
-                               return; \
+                               RETURN_THROWS(); \
                        } \
                        if ((dirp = (php_stream *)zend_fetch_resource_ex(tmp, "Directory", php_file_le_stream())) == NULL) { \
                                return; \