mirror of
https://github.com/php/php-src.git
synced 2025-08-19 08:49:28 +02:00
Don't take failing on an include file so badly
This commit is contained in:
parent
d6595d628c
commit
9f106c61ec
1 changed files with 11 additions and 8 deletions
|
@ -266,6 +266,7 @@ ZEND_API zend_op_array *v_compile_files(int mark_as_ref CLS_DC, int file_count,
|
||||||
zend_file_handle *file_handle;
|
zend_file_handle *file_handle;
|
||||||
int i;
|
int i;
|
||||||
int compiler_result;
|
int compiler_result;
|
||||||
|
int compiled_files=0;
|
||||||
|
|
||||||
init_op_array(op_array, INITIAL_OP_ARRAY_SIZE);
|
init_op_array(op_array, INITIAL_OP_ARRAY_SIZE);
|
||||||
save_lexical_state(&original_lex_state CLS_CC);
|
save_lexical_state(&original_lex_state CLS_CC);
|
||||||
|
@ -278,11 +279,6 @@ ZEND_API zend_op_array *v_compile_files(int mark_as_ref CLS_DC, int file_count,
|
||||||
}
|
}
|
||||||
if (open_file_for_scanning(file_handle CLS_CC)==FAILURE) {
|
if (open_file_for_scanning(file_handle CLS_CC)==FAILURE) {
|
||||||
zend_message_dispatcher(ZMSG_FAILED_INCLUDE_FOPEN, file_handle->filename);
|
zend_message_dispatcher(ZMSG_FAILED_INCLUDE_FOPEN, file_handle->filename);
|
||||||
|
|
||||||
destroy_op_array(op_array);
|
|
||||||
efree(op_array);
|
|
||||||
retval = NULL;
|
|
||||||
break;
|
|
||||||
} else {
|
} else {
|
||||||
CG(active_op_array) = op_array;
|
CG(active_op_array) = op_array;
|
||||||
compiler_result = zendparse(CLS_C);
|
compiler_result = zendparse(CLS_C);
|
||||||
|
@ -294,14 +290,21 @@ ZEND_API zend_op_array *v_compile_files(int mark_as_ref CLS_DC, int file_count,
|
||||||
retval = NULL;
|
retval = NULL;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
compiled_files++;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (retval) {
|
if (retval) {
|
||||||
|
if (compiled_files>0) {
|
||||||
pass_two(op_array);
|
pass_two(op_array);
|
||||||
if (mark_as_ref) {
|
if (mark_as_ref) {
|
||||||
pass_include_eval(op_array);
|
pass_include_eval(op_array);
|
||||||
}
|
}
|
||||||
|
} else {
|
||||||
|
destroy_op_array(op_array);
|
||||||
|
efree(op_array);
|
||||||
|
retval = NULL;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
return retval;
|
return retval;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue