mirror of
https://github.com/php/php-src.git
synced 2025-08-16 14:08:47 +02:00
Fixes for possible failure of zend_eval_string().
This commit is contained in:
parent
4b87dccefc
commit
0060f95699
2 changed files with 8 additions and 2 deletions
|
@ -585,7 +585,10 @@ static int _preg_do_eval(char *eval_str, char *subject, int *offsets,
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Run the code */
|
/* Run the code */
|
||||||
zend_eval_string(code, &retval CLS_CC ELS_CC);
|
if (zend_eval_string(code, &retval CLS_CC ELS_CC) == FAILURE) {
|
||||||
|
zend_error(E_ERROR, "Failed evaluating code:\n%s\n", code);
|
||||||
|
/* zend_error() does not return in this case */
|
||||||
|
}
|
||||||
convert_to_string(&retval);
|
convert_to_string(&retval);
|
||||||
|
|
||||||
/* Save the return value and its length */
|
/* Save the return value and its length */
|
||||||
|
|
|
@ -160,7 +160,10 @@ PHP_FUNCTION(assert)
|
||||||
EG(error_reporting) = 0;
|
EG(error_reporting) = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
zend_eval_string(myeval, &retval CLS_CC ELS_CC);
|
if (zend_eval_string(myeval, &retval CLS_CC ELS_CC) == FAILURE) {
|
||||||
|
zend_error(E_ERROR, "Failure evaluating code:\n%s\n", myeval);
|
||||||
|
/* zend_error() does not return in this case. */
|
||||||
|
}
|
||||||
|
|
||||||
if (ASSERT(quiet_eval)) {
|
if (ASSERT(quiet_eval)) {
|
||||||
EG(error_reporting) = old_error_reporting;
|
EG(error_reporting) = old_error_reporting;
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue