com php-src: Fixed check for eval(): main/main.c
| From: | Dmitry Stogov | Date: | Thu, 31 Jul 2014 06:52:48 +0000 |
| Subject: | com php-src: Fixed check for eval(): main/main.c | ||
| Groups: | php.cvs | ||
| Request: | Send a blank email to php-cvs+get-79691@lists.php.net to get a copy of this message | ||
Commit: 72753068873921ad4b970623c1e727f9a7d7b5eb
Author: Dmitry Stogov <dmitry@zend.com> Thu, 31 Jul 2014 10:52:48 +0400
Parents: c201ba8fffd967b9cc5dcf18bd46cc9d025cb955
Branches: phpng
Link: http://git.php.net/?p=php-src.git;a=commitdiff;h=72753068873921ad4b970623c1e727f9a7d7b5eb
Log:
Fixed check for eval()
Changed paths:
M main/main.c
Diff:
diff --git a/main/main.c b/main/main.c
index f4f88d5..3b9330e 100644
--- a/main/main.c
+++ b/main/main.c
@@ -1192,10 +1192,19 @@ static void php_error_cb(int type, const char *error_filename, const uint
error_
case E_USER_ERROR:
{ /* new block to allow variable definition */
/* eval() errors do not affect exit_status or response code */
- zend_bool during_eval = (type == E_PARSE) && (EG(current_execute_data) &&
- EG(current_execute_data)->opline &&
- EG(current_execute_data)->opline->opcode == ZEND_INCLUDE_OR_EVAL &&
- EG(current_execute_data)->opline->extended_value == ZEND_EVAL);
+ zend_bool during_eval = 0;
+
+ if (type == E_PARSE) {
+ zend_execute_data *execute_data = EG(current_execute_data);
+
+ while (execute_data && (!execute_data->func ||
!ZEND_USER_CODE(execute_data->func->common.type))) {
+ execute_data = execute_data->prev_execute_data;
+ }
+
+ during_eval = (execute_data &&
+ execute_data->opline->opcode == ZEND_INCLUDE_OR_EVAL &&
+ execute_data->opline->extended_value == ZEND_EVAL);
+ }
if (!during_eval) {
EG(exit_status) = 255;
}