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) {
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;
#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);
if (!vptr) {
xmlSchemaFree(sptr);
zend_throw_error(NULL, "Invalid Schema Validation Context");
- RETURN_FALSE;
+ RETURN_THROWS();
}
if (flags & XML_SCHEMA_VAL_VC_I_CREATE) {
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);
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) {
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);
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);
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);
} 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 {
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)) {
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));
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();
}
}
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);
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 {
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);
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 {
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);
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 {
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();
}
}
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);
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);
}
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);
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) {
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();
}
}
#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(); \
} \
}
zval_ptr_dtor(return_value);
zend_throw_error(NULL, "Cannot copy hash");
- return;
+ RETURN_THROWS();
}
}
/* }}} */
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);
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);
"Object not initialized", 0 );
zend_throw_error(NULL, "Object not initialized");
- RETURN_FALSE;
+ RETURN_THROWS();
}
/*
"Object not initialized", 0 );
zend_throw_error(NULL, "Object not initialized");
- RETURN_FALSE;
+ RETURN_THROWS();
}
/* Get locale by specified type. */
"Object not initialized", 0 );
zend_throw_error(NULL, "Object not initialized");
- RETURN_FALSE;
+ RETURN_THROWS();
}
/*
"Object not initialized", 0 );
zend_throw_error(NULL, "Object not initialized");
- RETURN_FALSE;
+ RETURN_THROWS();
}
/*
}
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();
}
}
}
return; \
} \
zend_throw_error(NULL, "Internal error: Failed to retrieve the reflection object"); \
- return; \
+ RETURN_THROWS(); \
} \
} while (0)
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) {
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. */
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);
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();
}
}
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;
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; \