Fixes for possible failure of zend_eval_string().

This commit is contained in:
Andrei Zmievski 2000-05-06 17:57:34 +00:00
parent 4b87dccefc
commit 0060f95699
2 changed files with 8 additions and 2 deletions

View file

@ -585,7 +585,10 @@ static int _preg_do_eval(char *eval_str, char *subject, int *offsets,
}
/* 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);
/* Save the return value and its length */

View file

@ -160,7 +160,10 @@ PHP_FUNCTION(assert)
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)) {
EG(error_reporting) = old_error_reporting;