Skip to content

Commit

Permalink
MFH: Added hook for compile_string()
Browse files Browse the repository at this point in the history
  • Loading branch information
Stefan Esser committed Jun 13, 2006
1 parent 3ff5fb0 commit 7bbf353
Show file tree
Hide file tree
Showing 6 changed files with 9 additions and 6 deletions.
1 change: 1 addition & 0 deletions Zend/zend.c
Expand Up @@ -605,6 +605,7 @@ int zend_startup(zend_utility_functions *utility_functions, char **extensions, i
zend_getenv = utility_functions->getenv_function; zend_getenv = utility_functions->getenv_function;


zend_compile_file = compile_file; zend_compile_file = compile_file;
zend_compile_string = compile_string;
zend_execute = execute; zend_execute = execute;
zend_execute_internal = NULL; zend_execute_internal = NULL;
zend_throw_exception_hook = NULL; zend_throw_exception_hook = NULL;
Expand Down
1 change: 1 addition & 0 deletions Zend/zend_compile.c
Expand Up @@ -32,6 +32,7 @@
#endif /* ZEND_MULTIBYTE */ #endif /* ZEND_MULTIBYTE */


ZEND_API zend_op_array *(*zend_compile_file)(zend_file_handle *file_handle, int type TSRMLS_DC); ZEND_API zend_op_array *(*zend_compile_file)(zend_file_handle *file_handle, int type TSRMLS_DC);
ZEND_API zend_op_array *(*zend_compile_string)(zval *source_string, char *filename TSRMLS_DC);




#ifndef ZTS #ifndef ZTS
Expand Down
1 change: 1 addition & 0 deletions Zend/zend_compile.h
Expand Up @@ -321,6 +321,7 @@ void shutdown_compiler(TSRMLS_D);
void zend_init_compiler_data_structures(TSRMLS_D); void zend_init_compiler_data_structures(TSRMLS_D);


extern ZEND_API zend_op_array *(*zend_compile_file)(zend_file_handle *file_handle, int type TSRMLS_DC); extern ZEND_API zend_op_array *(*zend_compile_file)(zend_file_handle *file_handle, int type TSRMLS_DC);
extern ZEND_API zend_op_array *(*zend_compile_string)(zval *source_string, char *filename TSRMLS_DC);


ZEND_API int lex_scan(zval *zendlval TSRMLS_DC); ZEND_API int lex_scan(zval *zendlval TSRMLS_DC);
void startup_scanner(TSRMLS_D); void startup_scanner(TSRMLS_D);
Expand Down
2 changes: 1 addition & 1 deletion Zend/zend_execute_API.c
Expand Up @@ -1101,7 +1101,7 @@ ZEND_API int zend_eval_string(char *str, zval *retval_ptr, char *string_name TSR


original_handle_op_arrays = CG(handle_op_arrays); original_handle_op_arrays = CG(handle_op_arrays);
CG(handle_op_arrays) = 0; CG(handle_op_arrays) = 0;
new_op_array = compile_string(&pv, string_name TSRMLS_CC); new_op_array = zend_compile_string(&pv, string_name TSRMLS_CC);
CG(handle_op_arrays) = original_handle_op_arrays; CG(handle_op_arrays) = original_handle_op_arrays;


if (new_op_array) { if (new_op_array) {
Expand Down
2 changes: 1 addition & 1 deletion Zend/zend_vm_def.h
Expand Up @@ -2766,7 +2766,7 @@ ZEND_VM_HANDLER(73, ZEND_INCLUDE_OR_EVAL, CONST|TMP|VAR|CV, ANY)
case ZEND_EVAL: { case ZEND_EVAL: {
char *eval_desc = zend_make_compiled_string_description("eval()'d code" TSRMLS_CC); char *eval_desc = zend_make_compiled_string_description("eval()'d code" TSRMLS_CC);


new_op_array = compile_string(inc_filename, eval_desc TSRMLS_CC); new_op_array = zend_compile_string(inc_filename, eval_desc TSRMLS_CC);
efree(eval_desc); efree(eval_desc);
} }
break; break;
Expand Down
8 changes: 4 additions & 4 deletions Zend/zend_vm_execute.h
Expand Up @@ -1960,7 +1960,7 @@ static int ZEND_INCLUDE_OR_EVAL_SPEC_CONST_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
case ZEND_EVAL: { case ZEND_EVAL: {
char *eval_desc = zend_make_compiled_string_description("eval()'d code" TSRMLS_CC); char *eval_desc = zend_make_compiled_string_description("eval()'d code" TSRMLS_CC);


new_op_array = compile_string(inc_filename, eval_desc TSRMLS_CC); new_op_array = zend_compile_string(inc_filename, eval_desc TSRMLS_CC);
efree(eval_desc); efree(eval_desc);
} }
break; break;
Expand Down Expand Up @@ -4460,7 +4460,7 @@ static int ZEND_INCLUDE_OR_EVAL_SPEC_TMP_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
case ZEND_EVAL: { case ZEND_EVAL: {
char *eval_desc = zend_make_compiled_string_description("eval()'d code" TSRMLS_CC); char *eval_desc = zend_make_compiled_string_description("eval()'d code" TSRMLS_CC);


new_op_array = compile_string(inc_filename, eval_desc TSRMLS_CC); new_op_array = zend_compile_string(inc_filename, eval_desc TSRMLS_CC);
efree(eval_desc); efree(eval_desc);
} }
break; break;
Expand Down Expand Up @@ -7542,7 +7542,7 @@ static int ZEND_INCLUDE_OR_EVAL_SPEC_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
case ZEND_EVAL: { case ZEND_EVAL: {
char *eval_desc = zend_make_compiled_string_description("eval()'d code" TSRMLS_CC); char *eval_desc = zend_make_compiled_string_description("eval()'d code" TSRMLS_CC);


new_op_array = compile_string(inc_filename, eval_desc TSRMLS_CC); new_op_array = zend_compile_string(inc_filename, eval_desc TSRMLS_CC);
efree(eval_desc); efree(eval_desc);
} }
break; break;
Expand Down Expand Up @@ -19764,7 +19764,7 @@ static int ZEND_INCLUDE_OR_EVAL_SPEC_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
case ZEND_EVAL: { case ZEND_EVAL: {
char *eval_desc = zend_make_compiled_string_description("eval()'d code" TSRMLS_CC); char *eval_desc = zend_make_compiled_string_description("eval()'d code" TSRMLS_CC);


new_op_array = compile_string(inc_filename, eval_desc TSRMLS_CC); new_op_array = zend_compile_string(inc_filename, eval_desc TSRMLS_CC);
efree(eval_desc); efree(eval_desc);
} }
break; break;
Expand Down

0 comments on commit 7bbf353

Please sign in to comment.