1999-04-08 02:10:10 +08:00
|
|
|
/*
|
|
|
|
+----------------------------------------------------------------------+
|
|
|
|
| Zend Engine |
|
|
|
|
+----------------------------------------------------------------------+
|
2016-01-02 17:56:11 +08:00
|
|
|
| Copyright (c) 1998-2016 Zend Technologies Ltd. (http://www.zend.com) |
|
1999-04-08 02:10:10 +08:00
|
|
|
+----------------------------------------------------------------------+
|
2001-12-11 23:16:21 +08:00
|
|
|
| This source file is subject to version 2.00 of the Zend license, |
|
2015-01-03 17:22:58 +08:00
|
|
|
| that is bundled with this package in the file LICENSE, and is |
|
2003-06-11 04:04:29 +08:00
|
|
|
| available through the world-wide-web at the following url: |
|
2001-12-11 23:16:21 +08:00
|
|
|
| http://www.zend.com/license/2_00.txt. |
|
1999-07-16 22:58:16 +08:00
|
|
|
| If you did not receive a copy of the Zend license and are unable to |
|
|
|
|
| obtain it through the world-wide-web, please send a note to |
|
|
|
|
| license@zend.com so we can mail you a copy immediately. |
|
1999-04-08 02:10:10 +08:00
|
|
|
+----------------------------------------------------------------------+
|
|
|
|
| Authors: Andi Gutmans <andi@zend.com> |
|
|
|
|
| Zeev Suraski <zeev@zend.com> |
|
|
|
|
+----------------------------------------------------------------------+
|
|
|
|
*/
|
|
|
|
|
2003-02-01 09:49:15 +08:00
|
|
|
/* $Id$ */
|
1999-07-16 22:58:16 +08:00
|
|
|
|
2000-07-03 08:55:36 +08:00
|
|
|
#ifndef ZEND_GLOBALS_H
|
|
|
|
#define ZEND_GLOBALS_H
|
1999-04-08 02:10:10 +08:00
|
|
|
|
1999-09-06 03:03:35 +08:00
|
|
|
|
1999-04-08 02:10:10 +08:00
|
|
|
#include <setjmp.h>
|
|
|
|
|
1999-09-06 03:03:35 +08:00
|
|
|
#include "zend_globals_macros.h"
|
|
|
|
|
1999-04-08 02:10:10 +08:00
|
|
|
#include "zend_stack.h"
|
|
|
|
#include "zend_ptr_stack.h"
|
|
|
|
#include "zend_hash.h"
|
|
|
|
#include "zend_llist.h"
|
2002-02-07 22:08:43 +08:00
|
|
|
#include "zend_objects.h"
|
2002-05-31 20:09:19 +08:00
|
|
|
#include "zend_objects_API.h"
|
2004-03-31 02:36:53 +08:00
|
|
|
#include "zend_modules.h"
|
2010-07-09 17:02:14 +08:00
|
|
|
#include "zend_float.h"
|
2008-06-29 16:21:35 +08:00
|
|
|
#include "zend_multibyte.h"
|
2015-04-11 04:01:00 +08:00
|
|
|
#include "zend_multiply.h"
|
2014-06-18 06:47:01 +08:00
|
|
|
#include "zend_arena.h"
|
2008-06-29 16:21:35 +08:00
|
|
|
|
1999-04-21 11:49:09 +08:00
|
|
|
/* Define ZTS if you want a thread-safe Zend */
|
1999-04-21 23:35:57 +08:00
|
|
|
/*#undef ZTS*/
|
1999-04-08 02:10:10 +08:00
|
|
|
|
|
|
|
#ifdef ZTS
|
1999-04-23 11:32:33 +08:00
|
|
|
|
|
|
|
BEGIN_EXTERN_C()
|
1999-04-25 00:16:11 +08:00
|
|
|
ZEND_API extern int compiler_globals_id;
|
|
|
|
ZEND_API extern int executor_globals_id;
|
1999-04-23 11:32:33 +08:00
|
|
|
END_EXTERN_C()
|
|
|
|
|
1999-04-08 02:10:10 +08:00
|
|
|
#endif
|
|
|
|
|
|
|
|
#define SYMTABLE_CACHE_SIZE 32
|
|
|
|
|
|
|
|
|
|
|
|
#include "zend_compile.h"
|
|
|
|
|
1999-10-05 23:13:22 +08:00
|
|
|
/* excpt.h on Digital Unix 4.0 defines function_table */
|
|
|
|
#undef function_table
|
2000-01-25 03:00:30 +08:00
|
|
|
|
2008-03-18 16:36:30 +08:00
|
|
|
#define ZEND_EARLY_BINDING_COMPILE_TIME 0
|
|
|
|
#define ZEND_EARLY_BINDING_DELAYED 1
|
|
|
|
#define ZEND_EARLY_BINDING_DELAYED_ALL 2
|
2000-01-25 03:00:30 +08:00
|
|
|
|
2008-01-24 17:41:39 +08:00
|
|
|
typedef struct _zend_vm_stack *zend_vm_stack;
|
2010-08-18 21:58:13 +08:00
|
|
|
typedef struct _zend_ini_entry zend_ini_entry;
|
|
|
|
|
2000-01-25 03:00:30 +08:00
|
|
|
|
1999-04-08 02:10:10 +08:00
|
|
|
struct _zend_compiler_globals {
|
2015-07-10 08:31:52 +08:00
|
|
|
zend_stack loop_var_stack;
|
|
|
|
|
2001-10-30 01:19:02 +08:00
|
|
|
zend_class_entry *active_class_entry;
|
1999-04-08 02:10:10 +08:00
|
|
|
|
2014-02-10 14:04:30 +08:00
|
|
|
zend_string *compiled_filename;
|
1999-04-08 02:10:10 +08:00
|
|
|
|
|
|
|
int zend_lineno;
|
2008-04-10 04:50:58 +08:00
|
|
|
|
1999-04-08 02:10:10 +08:00
|
|
|
zend_op_array *active_op_array;
|
|
|
|
|
|
|
|
HashTable *function_table; /* function symbol table */
|
|
|
|
HashTable *class_table; /* class table */
|
|
|
|
|
2000-08-20 01:50:42 +08:00
|
|
|
HashTable filenames_table;
|
1999-04-08 02:10:10 +08:00
|
|
|
|
2001-08-09 01:18:16 +08:00
|
|
|
HashTable *auto_globals;
|
|
|
|
|
2011-06-24 07:00:53 +08:00
|
|
|
zend_bool parse_error;
|
2000-02-04 22:45:58 +08:00
|
|
|
zend_bool in_compilation;
|
1999-07-02 22:10:57 +08:00
|
|
|
zend_bool short_tags;
|
1999-04-08 02:10:10 +08:00
|
|
|
|
1999-07-02 22:10:57 +08:00
|
|
|
zend_bool unclean_shutdown;
|
1999-05-22 10:13:01 +08:00
|
|
|
|
2000-10-31 07:19:48 +08:00
|
|
|
zend_bool ini_parser_unbuffered_errors;
|
|
|
|
|
1999-05-22 10:13:01 +08:00
|
|
|
zend_llist open_files;
|
2001-07-15 22:08:58 +08:00
|
|
|
|
2001-08-06 21:48:51 +08:00
|
|
|
struct _zend_ini_parser_param *ini_parser_param;
|
|
|
|
|
2014-08-26 01:28:33 +08:00
|
|
|
uint32_t start_lineno;
|
2001-08-06 22:36:46 +08:00
|
|
|
zend_bool increment_lineno;
|
2002-03-03 04:38:52 +08:00
|
|
|
|
2014-02-10 14:04:30 +08:00
|
|
|
zend_string *doc_comment;
|
2016-05-13 06:40:15 +08:00
|
|
|
uint32_t extra_fn_flags;
|
2003-08-11 13:24:42 +08:00
|
|
|
|
2014-08-26 01:28:33 +08:00
|
|
|
uint32_t compiler_options; /* set of ZEND_COMPILE_* constants */
|
2008-03-18 16:36:30 +08:00
|
|
|
|
2013-08-25 05:53:43 +08:00
|
|
|
HashTable const_filenames;
|
|
|
|
|
2015-04-20 23:39:32 +08:00
|
|
|
zend_oparray_context context;
|
|
|
|
zend_file_context file_context;
|
2008-03-28 22:35:01 +08:00
|
|
|
|
2014-06-18 06:47:01 +08:00
|
|
|
zend_arena *arena;
|
2015-01-03 17:22:58 +08:00
|
|
|
|
2014-02-10 14:04:30 +08:00
|
|
|
zend_string *empty_string;
|
2014-04-01 22:06:50 +08:00
|
|
|
zend_string *one_char_string[256];
|
2016-05-12 18:47:22 +08:00
|
|
|
zend_string **known_strings;
|
|
|
|
uint32_t known_strings_count;
|
2010-04-20 19:05:54 +08:00
|
|
|
|
|
|
|
HashTable interned_strings;
|
|
|
|
|
2010-12-20 00:36:37 +08:00
|
|
|
const zend_encoding **script_encoding_list;
|
2008-07-25 06:21:41 +08:00
|
|
|
size_t script_encoding_list_size;
|
2010-11-24 13:41:23 +08:00
|
|
|
zend_bool multibyte;
|
2008-06-29 16:21:35 +08:00
|
|
|
zend_bool detect_unicode;
|
2008-07-25 06:21:41 +08:00
|
|
|
zend_bool encoding_declared;
|
2008-06-29 16:21:35 +08:00
|
|
|
|
2014-07-28 21:49:33 +08:00
|
|
|
zend_ast *ast;
|
|
|
|
zend_arena *ast_arena;
|
|
|
|
|
2014-08-15 23:10:06 +08:00
|
|
|
zend_stack delayed_oplines_stack;
|
|
|
|
|
2005-12-01 19:48:17 +08:00
|
|
|
#ifdef ZTS
|
2014-04-09 21:51:28 +08:00
|
|
|
zval **static_members_table;
|
2005-12-01 19:48:17 +08:00
|
|
|
int last_static_member;
|
|
|
|
#endif
|
1999-04-08 02:10:10 +08:00
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
struct _zend_executor_globals {
|
|
|
|
zval uninitialized_zval;
|
|
|
|
zval error_zval;
|
|
|
|
|
|
|
|
/* symbol table cache */
|
2014-03-18 03:15:22 +08:00
|
|
|
zend_array *symtable_cache[SYMTABLE_CACHE_SIZE];
|
|
|
|
zend_array **symtable_cache_limit;
|
|
|
|
zend_array **symtable_cache_ptr;
|
1999-04-08 02:10:10 +08:00
|
|
|
|
2014-02-10 14:04:30 +08:00
|
|
|
zend_array symbol_table; /* main symbol table */
|
1999-04-08 02:10:10 +08:00
|
|
|
|
2000-03-11 00:36:30 +08:00
|
|
|
HashTable included_files; /* files already included */
|
1999-12-01 04:15:04 +08:00
|
|
|
|
2008-03-19 05:14:28 +08:00
|
|
|
JMP_BUF *bailout;
|
1999-04-08 02:10:10 +08:00
|
|
|
|
|
|
|
int error_reporting;
|
2000-11-22 12:24:35 +08:00
|
|
|
int exit_status;
|
1999-04-08 02:10:10 +08:00
|
|
|
|
|
|
|
HashTable *function_table; /* function symbol table */
|
|
|
|
HashTable *class_table; /* class table */
|
|
|
|
HashTable *zend_constants; /* constants table */
|
|
|
|
|
2014-10-10 00:29:02 +08:00
|
|
|
zval *vm_stack_top;
|
|
|
|
zval *vm_stack_end;
|
|
|
|
zend_vm_stack vm_stack;
|
|
|
|
|
|
|
|
struct _zend_execute_data *current_execute_data;
|
2016-04-28 09:13:34 +08:00
|
|
|
zend_class_entry *fake_scope; /* used to avoid checks accessing properties */
|
2001-12-07 01:47:04 +08:00
|
|
|
|
2014-08-26 01:24:55 +08:00
|
|
|
zend_long precision;
|
1999-04-08 02:10:10 +08:00
|
|
|
|
2000-01-25 03:00:30 +08:00
|
|
|
int ticks_count;
|
|
|
|
|
2004-03-24 22:30:59 +08:00
|
|
|
HashTable *in_autoload;
|
2004-08-24 04:57:40 +08:00
|
|
|
zend_function *autoload_func;
|
2001-10-23 09:23:36 +08:00
|
|
|
zend_bool full_tables_cleanup;
|
2000-02-04 22:45:58 +08:00
|
|
|
|
1999-04-08 02:10:10 +08:00
|
|
|
/* for extended information support */
|
1999-07-29 01:59:55 +08:00
|
|
|
zend_bool no_extensions;
|
1999-04-08 02:10:10 +08:00
|
|
|
|
2000-06-16 22:27:28 +08:00
|
|
|
zend_bool timed_out;
|
2016-04-20 18:52:21 +08:00
|
|
|
zend_long hard_timeout;
|
|
|
|
|
|
|
|
#ifdef ZEND_WIN32
|
2009-01-16 08:57:43 +08:00
|
|
|
OSVERSIONINFOEX windows_version_info;
|
2000-06-16 22:27:28 +08:00
|
|
|
#endif
|
|
|
|
|
1999-04-08 02:10:10 +08:00
|
|
|
HashTable regular_list;
|
|
|
|
HashTable persistent_list;
|
|
|
|
|
2004-01-10 19:43:42 +08:00
|
|
|
int user_error_handler_error_reporting;
|
2014-02-10 14:04:30 +08:00
|
|
|
zval user_error_handler;
|
|
|
|
zval user_exception_handler;
|
2004-01-10 19:43:42 +08:00
|
|
|
zend_stack user_error_handlers_error_reporting;
|
2014-02-10 14:04:30 +08:00
|
|
|
zend_stack user_error_handlers;
|
|
|
|
zend_stack user_exception_handlers;
|
2000-04-19 23:08:06 +08:00
|
|
|
|
2008-03-09 05:54:03 +08:00
|
|
|
zend_error_handling_t error_handling;
|
|
|
|
zend_class_entry *exception_class;
|
|
|
|
|
2000-06-16 09:54:56 +08:00
|
|
|
/* timeout support */
|
2014-08-26 01:24:55 +08:00
|
|
|
zend_long timeout_seconds;
|
2000-06-16 09:54:56 +08:00
|
|
|
|
2000-06-03 09:49:49 +08:00
|
|
|
int lambda_count;
|
|
|
|
|
2002-09-24 01:20:59 +08:00
|
|
|
HashTable *ini_directives;
|
2006-05-15 22:52:35 +08:00
|
|
|
HashTable *modified_ini_directives;
|
2015-01-03 17:22:58 +08:00
|
|
|
zend_ini_entry *error_reporting_ini_entry;
|
2006-05-15 22:52:35 +08:00
|
|
|
|
2002-05-31 20:09:19 +08:00
|
|
|
zend_objects_store objects_store;
|
2014-02-10 14:04:30 +08:00
|
|
|
zend_object *exception, *prev_exception;
|
2014-08-28 06:44:06 +08:00
|
|
|
const zend_op *opline_before_exception;
|
2008-01-22 03:39:55 +08:00
|
|
|
zend_op exception_op[3];
|
2000-12-27 23:43:15 +08:00
|
|
|
|
2004-03-31 02:36:53 +08:00
|
|
|
struct _zend_module_entry *current_module;
|
2004-02-03 20:17:09 +08:00
|
|
|
|
2014-07-04 22:03:45 +08:00
|
|
|
zend_bool active;
|
|
|
|
zend_bool valid_symbol_table;
|
2006-09-11 22:30:08 +08:00
|
|
|
|
2015-03-02 17:25:40 +08:00
|
|
|
zend_long assertions;
|
|
|
|
|
2015-02-12 18:57:12 +08:00
|
|
|
uint32_t ht_iterators_count; /* number of allocatd slots */
|
|
|
|
uint32_t ht_iterators_used; /* number of used slots */
|
|
|
|
HashTableIterator *ht_iterators;
|
|
|
|
HashTableIterator ht_iterators_slots[16];
|
|
|
|
|
2010-07-09 17:02:14 +08:00
|
|
|
void *saved_fpu_cw_ptr;
|
|
|
|
#if XPFPA_HAVE_CW
|
|
|
|
XPFPA_CW_DATATYPE saved_fpu_cw;
|
|
|
|
#endif
|
2009-03-18 18:18:10 +08:00
|
|
|
|
2015-04-11 04:01:00 +08:00
|
|
|
zend_function trampoline;
|
|
|
|
zend_op call_trampoline_op;
|
|
|
|
|
1999-08-16 03:29:39 +08:00
|
|
|
void *reserved[ZEND_MAX_RESERVED_RESOURCES];
|
1999-04-08 02:10:10 +08:00
|
|
|
};
|
|
|
|
|
2008-03-17 05:06:55 +08:00
|
|
|
struct _zend_ini_scanner_globals {
|
2003-02-18 17:37:54 +08:00
|
|
|
zend_file_handle *yy_in;
|
|
|
|
zend_file_handle *yy_out;
|
2008-03-17 05:06:55 +08:00
|
|
|
|
2008-07-25 06:21:41 +08:00
|
|
|
unsigned int yy_leng;
|
|
|
|
unsigned char *yy_start;
|
|
|
|
unsigned char *yy_text;
|
|
|
|
unsigned char *yy_cursor;
|
|
|
|
unsigned char *yy_marker;
|
|
|
|
unsigned char *yy_limit;
|
|
|
|
int yy_state;
|
|
|
|
zend_stack state_stack;
|
2008-03-17 05:06:55 +08:00
|
|
|
|
|
|
|
char *filename;
|
2002-10-15 07:41:32 +08:00
|
|
|
int lineno;
|
2008-03-17 05:06:55 +08:00
|
|
|
|
2014-09-01 21:22:28 +08:00
|
|
|
/* Modes are: ZEND_INI_SCANNER_NORMAL, ZEND_INI_SCANNER_RAW, ZEND_INI_SCANNER_TYPED */
|
2007-09-28 10:05:10 +08:00
|
|
|
int scanner_mode;
|
2008-03-17 05:06:55 +08:00
|
|
|
};
|
|
|
|
|
2015-04-05 19:50:35 +08:00
|
|
|
typedef enum {
|
|
|
|
ON_TOKEN,
|
|
|
|
ON_FEEDBACK,
|
|
|
|
ON_STOP
|
|
|
|
} zend_php_scanner_event;
|
|
|
|
|
2008-03-17 05:06:55 +08:00
|
|
|
struct _zend_php_scanner_globals {
|
|
|
|
zend_file_handle *yy_in;
|
|
|
|
zend_file_handle *yy_out;
|
2007-09-28 10:05:10 +08:00
|
|
|
|
2008-03-17 05:06:55 +08:00
|
|
|
unsigned int yy_leng;
|
|
|
|
unsigned char *yy_start;
|
|
|
|
unsigned char *yy_text;
|
|
|
|
unsigned char *yy_cursor;
|
|
|
|
unsigned char *yy_marker;
|
|
|
|
unsigned char *yy_limit;
|
|
|
|
int yy_state;
|
|
|
|
zend_stack state_stack;
|
2012-03-31 02:41:44 +08:00
|
|
|
zend_ptr_stack heredoc_label_stack;
|
2015-01-03 17:22:58 +08:00
|
|
|
|
2008-06-29 16:21:35 +08:00
|
|
|
/* original (unfiltered) script */
|
2008-07-25 06:21:41 +08:00
|
|
|
unsigned char *script_org;
|
|
|
|
size_t script_org_size;
|
2008-06-29 16:21:35 +08:00
|
|
|
|
|
|
|
/* filtered script */
|
2008-07-25 06:21:41 +08:00
|
|
|
unsigned char *script_filtered;
|
|
|
|
size_t script_filtered_size;
|
2008-06-29 16:21:35 +08:00
|
|
|
|
2013-07-24 07:55:43 +08:00
|
|
|
/* input/output filters */
|
2008-06-29 16:21:35 +08:00
|
|
|
zend_encoding_filter input_filter;
|
|
|
|
zend_encoding_filter output_filter;
|
2010-12-20 00:36:37 +08:00
|
|
|
const zend_encoding *script_encoding;
|
2014-02-10 14:04:30 +08:00
|
|
|
|
|
|
|
/* initial string length after scanning to first variable */
|
|
|
|
int scanned_string_len;
|
2015-04-05 19:50:35 +08:00
|
|
|
|
|
|
|
/* hooks */
|
|
|
|
void (* on_event)(zend_php_scanner_event event, int token, int line);
|
2001-08-06 21:48:51 +08:00
|
|
|
};
|
|
|
|
|
2000-07-03 08:55:36 +08:00
|
|
|
#endif /* ZEND_GLOBALS_H */
|
2003-02-01 09:49:15 +08:00
|
|
|
|
|
|
|
/*
|
|
|
|
* Local variables:
|
|
|
|
* tab-width: 4
|
|
|
|
* c-basic-offset: 4
|
|
|
|
* indent-tabs-mode: t
|
|
|
|
* End:
|
|
|
|
*/
|