Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 1 addition & 5 deletions Zend/zend.c
Original file line number Diff line number Diff line change
Expand Up @@ -1830,11 +1830,7 @@ ZEND_API ZEND_COLD void zend_throw_error(zend_class_entry *exception_ce, const c

//TODO: we can't convert compile-time errors to exceptions yet???
if (EG(current_execute_data) && !CG(in_compilation)) {
// %S is used for zend_string pointers by smart str printing, but normally
// is for wide character strings and so compilers complain if this is inline
// Use "%S" so that the message can contain null bytes.
const char *format = "%S";
zend_throw_exception_ex(exception_ce, 0, format, message);
zend_throw_exception_ex(exception_ce, 0, "%pS", message);
} else {
zend_error_noreturn(E_ERROR, "%s", ZSTR_VAL(message));
}
Expand Down
3 changes: 1 addition & 2 deletions Zend/zend_partial.c
Original file line number Diff line number Diff line change
Expand Up @@ -701,8 +701,7 @@ static zend_op_array *zp_compile(zval *this_ptr, zend_function *function,
zend_op_array *op_array = NULL;

if (UNEXPECTED(function->common.fn_flags2 & ZEND_ACC2_FORBID_DYN_CALLS)) {
const char *format = "Cannot call %S() dynamically";
zend_throw_error(NULL, format, function->common.function_name);
zend_throw_error(NULL, "Cannot call %pS() dynamically", function->common.function_name);
return NULL;
}

Expand Down
Loading