summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndrei Zmievski <andrei@php.net>2000-05-06 17:57:34 +0000
committerAndrei Zmievski <andrei@php.net>2000-05-06 17:57:34 +0000
commit0060f95699012292196747d40ef6e7c670b10fa7 (patch)
treeb48aab5710a9bd86aa1abdd5b6243e9bdccdfefe
parent4b87dccefc05717e188c49a94862b3137b444aaa (diff)
downloadphp-git-0060f95699012292196747d40ef6e7c670b10fa7.tar.gz
Fixes for possible failure of zend_eval_string().
-rw-r--r--ext/pcre/php_pcre.c5
-rw-r--r--ext/standard/assert.c5
2 files changed, 8 insertions, 2 deletions
diff --git a/ext/pcre/php_pcre.c b/ext/pcre/php_pcre.c
index 09f1641047..fa94b3e09f 100644
--- a/ext/pcre/php_pcre.c
+++ b/ext/pcre/php_pcre.c
@@ -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 */
diff --git a/ext/standard/assert.c b/ext/standard/assert.c
index e9a0417a12..b55239c3ce 100644
--- a/ext/standard/assert.c
+++ b/ext/standard/assert.c
@@ -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;