Skip to content

Commit

Permalink
Improve argument error messages in ext/sodium
Browse files Browse the repository at this point in the history
  • Loading branch information
kocsismate committed Feb 24, 2020
1 parent c3aa913 commit 02f70d9
Show file tree
Hide file tree
Showing 4 changed files with 128 additions and 258 deletions.
7 changes: 1 addition & 6 deletions Zend/zend.c
Original file line number Diff line number Diff line change
Expand Up @@ -1528,12 +1528,7 @@ ZEND_API ZEND_COLD void zend_throw_error(zend_class_entry *exception_ce, const c
va_list va;
char *message = NULL;

if (exception_ce) {
if (!instanceof_function(exception_ce, zend_ce_error)) {
zend_error(E_NOTICE, "Error exceptions must be derived from Error");
exception_ce = zend_ce_error;
}
} else {
if (!exception_ce) {
exception_ce = zend_ce_error;
}

Expand Down
Loading

0 comments on commit 02f70d9

Please sign in to comment.