Introduce zend_error_unchecked()

To be used with custom formats like %H as otherwise the compiler complains about unknown formats
This commit is contained in:
George Peter Banyard 2021-04-19 13:25:36 +01:00
parent 950bb84c7e
commit d24cf1a417
No known key found for this signature in database
GPG Key ID: D49A095D7329F6DC
2 changed files with 14 additions and 1 deletions

View File

@ -489,7 +489,7 @@ static void zend_print_zval_r_to_buf(smart_str *buf, zval *expr, int indent) /*
}
smart_str_appendc(buf, '\n');
}
if (GC_IS_RECURSIVE(Z_OBJ_P(expr))) {
smart_str_appends(buf, " *RECURSION*");
return;
@ -1529,6 +1529,17 @@ ZEND_API ZEND_COLD void zend_error(int type, const char *format, ...) {
va_end(args);
}
ZEND_API ZEND_COLD void zend_error_unchecked(int type, const char *format, ...) {
const char *filename;
uint32_t lineno;
va_list args;
get_filename_lineno(type, &filename, &lineno);
va_start(args, format);
zend_error_va_list(type, filename, lineno, format, args);
va_end(args);
}
ZEND_API ZEND_COLD ZEND_NORETURN void zend_error_at_noreturn(
int type, const char *filename, uint32_t lineno, const char *format, ...)
{

View File

@ -327,6 +327,8 @@ extern ZEND_API zend_result (*zend_preload_autoload)(zend_string *filename);
ZEND_API ZEND_COLD void zend_error(int type, const char *format, ...) ZEND_ATTRIBUTE_FORMAT(printf, 2, 3);
ZEND_API ZEND_COLD ZEND_NORETURN void zend_error_noreturn(int type, const char *format, ...) ZEND_ATTRIBUTE_FORMAT(printf, 2, 3);
/* For custom format specifiers like H */
ZEND_API ZEND_COLD void zend_error_unchecked(int type, const char *format, ...);
/* If filename is NULL the default filename is used. */
ZEND_API ZEND_COLD void zend_error_at(int type, const char *filename, uint32_t lineno, const char *format, ...) ZEND_ATTRIBUTE_FORMAT(printf, 4, 5);
ZEND_API ZEND_COLD ZEND_NORETURN void zend_error_at_noreturn(int type, const char *filename, uint32_t lineno, const char *format, ...) ZEND_ATTRIBUTE_FORMAT(printf, 4, 5);