diff options
author | Zeev Suraski <zeev@php.net> | 2000-09-12 20:48:33 +0000 |
---|---|---|
committer | Zeev Suraski <zeev@php.net> | 2000-09-12 20:48:33 +0000 |
commit | 6c3d7449e12c7f6f82ce0c9d84afcecf6964d2c7 (patch) | |
tree | 5f023a8aa7a5be318bb93d9253f30c6142541200 /ext/pcre/php_pcre.c | |
parent | 5286b3971cbe7763f1f5aa918a5a909f61968fe8 (diff) | |
download | php-git-6c3d7449e12c7f6f82ce0c9d84afcecf6964d2c7.tar.gz |
- Made eval() and several other runtime-evaluated code portions report the
nature and location of errors more accurately (Stas)
Diffstat (limited to 'ext/pcre/php_pcre.c')
-rw-r--r-- | ext/pcre/php_pcre.c | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/ext/pcre/php_pcre.c b/ext/pcre/php_pcre.c index 6a5a74de9c..68b112ab8f 100644 --- a/ext/pcre/php_pcre.c +++ b/ext/pcre/php_pcre.c @@ -544,6 +544,7 @@ static int preg_do_eval(char *eval_str, int eval_str_len, char *subject, int esc_match_len; /* Length of the quote-escaped match */ int result_len; /* Length of the result of the evaluation */ int backref; /* Current backref */ + char *compiled_string_description; CLS_FETCH(); ELS_FETCH(); @@ -578,11 +579,14 @@ static int preg_do_eval(char *eval_str, int eval_str_len, char *subject, } } + compiled_string_description = zend_make_compiled_string_description("regexp code"); /* Run the code */ - if (zend_eval_string(code, &retval CLS_CC ELS_CC) == FAILURE) { + if (zend_eval_string(code, &retval, compiled_string_description CLS_CC ELS_CC) == FAILURE) { + efree(compiled_string_description); zend_error(E_ERROR, "Failed evaluating code:\n%s\n", code); /* zend_error() does not return in this case */ } + efree(compiled_string_description); convert_to_string(&retval); /* Save the return value and its length */ |