com php-src: Fix bug when constructing an Error with invalid params: Zend/zend_exceptions.c
| From: | Bob Weinand | Date: | Thu, 18 Jun 2015 00:48:17 +0000 |
| Subject: | com php-src: Fix bug when constructing an Error with invalid params: Zend/zend_exceptions.c | ||
| Groups: | php.cvs | ||
| Request: | Send a blank email to php-cvs+get-87354@lists.php.net to get a copy of this message | ||
Commit: 8813b389ea745b4dfaa72700844063de4de22859
Author: Aaron Piotrowski <aaron@trowski.com> Wed, 17 Jun 2015 19:48:17 -0500
Parents: f97dbb058f0ed9c01b6fe200cf7d3339e4179277
Branches: master
Link: http://git.php.net/?p=php-src.git;a=commitdiff;h=8813b389ea745b4dfaa72700844063de4de22859
Log:
Fix bug when constructing an Error with invalid params
Changed paths:
M Zend/zend_exceptions.c
Diff:
diff --git a/Zend/zend_exceptions.c b/Zend/zend_exceptions.c
index aff602c..f157abb 100644
--- a/Zend/zend_exceptions.c
+++ b/Zend/zend_exceptions.c
@@ -242,21 +242,21 @@ ZEND_METHOD(exception, __construct)
zend_class_entry *base_ce;
int argc = ZEND_NUM_ARGS();
+ object = getThis();
+ base_ce = zend_get_exception_base(object);
+
if (zend_parse_parameters_ex(ZEND_PARSE_PARAMS_QUIET, argc, "|SlO!", &message,
&code, &previous, zend_ce_throwable) == FAILURE) {
zend_class_entry *ce;
if (execute_data->called_scope) {
ce = execute_data->called_scope;
} else {
- ce = default_exception_ce;
+ ce = base_ce;
}
zend_error(E_EXCEPTION | E_ERROR, "Wrong parameters for %s([string $message [, long $code [,
Throwable $previous = NULL]]])", ce->name->val);
return;
}
- object = getThis();
- base_ce = zend_get_exception_base(object);
-
if (message) {
zend_update_property_str(base_ce, object, "message", sizeof("message")-1,
message);
}