mirror of
https://github.com/php/php-src.git
synced 2024-11-27 03:44:07 +08:00
MFH: fix #38779 (engine crashes when require()'ing file with syntax error through userspace stream wrapper)
This commit is contained in:
parent
0a1f5d12a1
commit
d6ee9d4810
@ -503,6 +503,7 @@ static void executor_globals_ctor(zend_executor_globals *executor_globals TSRMLS
|
||||
EG(current_execute_data) = NULL;
|
||||
EG(current_module) = NULL;
|
||||
EG(exit_status) = 0;
|
||||
EG(active) = 0;
|
||||
}
|
||||
|
||||
|
||||
|
@ -188,6 +188,8 @@ void init_executor(TSRMLS_D)
|
||||
EG(scope) = NULL;
|
||||
|
||||
EG(This) = NULL;
|
||||
|
||||
EG(active) = 1;
|
||||
}
|
||||
|
||||
static int zval_call_destructor(zval **zv TSRMLS_DC)
|
||||
@ -316,6 +318,7 @@ void shutdown_executor(TSRMLS_D)
|
||||
FREE_HASHTABLE(EG(in_autoload));
|
||||
}
|
||||
} zend_end_try();
|
||||
EG(active) = 0;
|
||||
}
|
||||
|
||||
|
||||
@ -613,6 +616,10 @@ int zend_call_function(zend_fcall_info *fci, zend_fcall_info_cache *fci_cache TS
|
||||
char *fname, *colon;
|
||||
int fname_len;
|
||||
|
||||
if (!EG(active)) {
|
||||
return FAILURE; /* executor is already inactive */
|
||||
}
|
||||
|
||||
if (EG(exception)) {
|
||||
return FAILURE; /* we would result in an instable executor otherwise */
|
||||
}
|
||||
|
@ -237,6 +237,8 @@ struct _zend_executor_globals {
|
||||
|
||||
zend_property_info std_property_info;
|
||||
|
||||
zend_bool active;
|
||||
|
||||
void *reserved[ZEND_MAX_RESERVED_RESOURCES];
|
||||
};
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user