summaryrefslogtreecommitdiff
path: root/Zend/zend.c
diff options
context:
space:
mode:
authorAaron Piotrowski <aaron@trowski.com>2015-07-03 16:04:33 -0500
committerAaron Piotrowski <aaron@trowski.com>2015-07-03 17:53:41 -0500
commit22c38b2ef58fc97ca8cd82ae456d0082d2a8cd22 (patch)
tree43c93840eeb0bdbbe32af87291f9ff4216c264aa /Zend/zend.c
parent5a99c07eccb09c3c8b9f6fe4b83020163aad6498 (diff)
downloadphp-git-22c38b2ef58fc97ca8cd82ae456d0082d2a8cd22.tar.gz
Remove need to pass error level
Diffstat (limited to 'Zend/zend.c')
-rw-r--r--Zend/zend.c21
1 files changed, 8 insertions, 13 deletions
diff --git a/Zend/zend.c b/Zend/zend.c
index b60a60413e..af2abd13c6 100644
--- a/Zend/zend.c
+++ b/Zend/zend.c
@@ -1292,26 +1292,21 @@ ZEND_API ZEND_NORETURN void zend_error_noreturn(int type, const char *format, ..
# endif
#endif
-ZEND_API void zend_throw_error(zend_class_entry *exception_ce, int type, const char *format, ...) /* {{{ */
+ZEND_API void zend_throw_error(zend_class_entry *exception_ce, const char *format, ...) /* {{{ */
{
va_list va;
char *message = NULL;
-
+
va_start(va, format);
zend_vspprintf(&message, 0, format, va);
- if (type & E_EXCEPTION) {
- type = E_ERROR; // Convert to E_ERROR if unable to throw.
- //TODO: we can't convert compile-time errors to exceptions yet???
- if (EG(current_execute_data) && !CG(in_compilation)) {
- zend_throw_exception(exception_ce, message, type);
- efree(message);
- va_end(va);
- return;
- }
+ // TODO: we can't convert compile-time errors to exceptions yet???
+ if (EG(current_execute_data) && !CG(in_compilation)) {
+ zend_throw_exception(exception_ce, message, E_ERROR);
+ } else {
+ zend_error(E_ERROR, message);
}
-
- zend_error(type, message);
+
efree(message);
va_end(va);
}